-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activity flow api changes. #2476
Conversation
… perform is called
workflow/src/main/java/com/google/android/fhir/workflow/activity/event/CPGEventResource.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/event/CPGEventResource.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/event/CPGEventResource.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/event/CPGEventResource.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/event/CPGEventResource.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a page in the doc folder?
workflow/src/test/java/com/google/android/fhir/workflow/activity/ActivityFlowTest.kt
Outdated
Show resolved
Hide resolved
...c/main/java/com/google/android/fhir/workflow/activity/resource/request/CPGRequestResource.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/ActivityFlow.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/ActivityFlow.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/ActivityFlow.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/ActivityFlow.kt
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/phase/request/PlanPhase.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/phase/request/PlanPhase.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/resource/event/CPGCaseEvent.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/ActivityFlow.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noting comments from bryn:
- Can we change "draft" to "prepare"
- Can we change "start" to "submit"
- Can we change "resume" in the test cases to "continue"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Aditya for the changes.
2 main concerns:-
- Should we consider making the operations asynchronous ? Since we are dealing with Repository it only makes sense to do the operations in a IO coroutine. Suggesting to make the initiate and update methods suspend functions.
- Do you think we should add a rollback api ? If there are errors in later phases one might want to rollback. To do this we could maintain a stack pf phases instead of only the currentPhase.
workflow/src/main/java/com/google/android/fhir/workflow/activity/ActivityFlow.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/ActivityFlow.kt
Outdated
Show resolved
Hide resolved
workflow/src/main/java/com/google/android/fhir/workflow/activity/ActivityFlow.kt
Show resolved
Hide resolved
workflow/src/test/java/com/google/android/fhir/workflow/activity/ActivityFlowTest.kt
Outdated
Show resolved
Hide resolved
workflow/src/test/java/com/google/android/fhir/workflow/activity/ActivityFlowTest.kt
Outdated
Show resolved
Hide resolved
workflow/src/test/java/com/google/android/fhir/workflow/activity/ActivityFlowTest.kt
Outdated
Show resolved
Hide resolved
ec9fbcd
to
0e8bcc7
Compare
…supported activities
0e8bcc7
to
011de6f
Compare
|
...src/main/java/com/google/android/fhir/workflow/activity/resource/request/StatusCodeMapper.kt
Show resolved
Hide resolved
.../main/java/com/google/android/fhir/workflow/activity/resource/event/EventStatusCodeMapper.kt
Outdated
Show resolved
Hide resolved
...ain/java/com/google/android/fhir/workflow/activity/resource/event/CPGOrderMedicationEvent.kt
Show resolved
Hide resolved
workflow/src/test/java/com/google/android/fhir/workflow/activity/ActivityFlowTest.kt
Show resolved
Hide resolved
38fe768
to
1ec1f94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2469
Description
Api for creating a flow to move a request through various phases of an ActivityFlow.
The class
ActivityFlow
has two main functionalities:e.g.
ActivityFlow.draftPlan
corresponds to beginPlan andActivityFlow.startPlan
corresponds to endPlan .The
Phase
class has two distinct hierarchiesRequestPhase
andEventPhase
each with unique apis to allow valid state transitions for Request based phases (Proposal, Plan and Order) and Event based phases (Perform) respectively.ActivityFlow
provides variousActivityFlow.of
static api to help user createActivityFlow
for particular activities with particular request or event types.Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type
Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.