@startuml Data_Element_Submission_Scenario title Data Element Submission Scenario participant "Data Repository" as DR participant "Submitting System" as Submitter participant "Knowledge Repository" as KR participant "Terminology Service" as TS participant "Receiving System" as Receiver == 1. Setup == loop per measure Submitter -> KR: $data-requirements KR -> KR: Process data requirements note right: 1. Include date-based filtering\n2. Map filters to search parameters\n3. Prune data elements based on measure usage (incl attr)\n4. Eliminate duplicates KR -> Submitter: Library.dataRequirement (0..*) end note right: Measure selection Submitter -> Submitter: Analyze requirements note right: 1. Collect value sets across data requirements Submitter -> TS: GET ValueSet(s) note right: Use CapabilityStatement\nDetermine applicable expansions TS -> Submitter: ValueSet(s) == 2. Attribution/Selection == loop per measure Submitter -> Submitter: Determine attribution note right: DaVinci Attribution use case loop per patient loop per selective data element Submitter -> DR: GET data element note right: Use fhirQueryPattern DR -> Submitter: Bundle end Submitter -> Submitter: Determine applicable population note right: If all bundles have data, patient is potentially a member of the IP end note right: Subset attributed patients by\ninitial population applicability end note right: Measure selection == 3. Submission == loop per patient loop per measure loop per data element not marked selective Submitter -> DR: GET data element note right: Use fhirQueryPattern DR -> Submitter: Bundle end Submitter -> Receiver: $submit-data note right: Submitter constructs a bundle with all\n data retrieved from the repository\nReturn errors encountered Receiver -> Submitter: OperationOutcome end end note right: Consider submission period\nConsider bulk data == 4. Evaluation (individual/group) == loop per measure Submitter -> Receiver: $evaluate-measure Receiver -> Submitter: MeasureReport end note right: Bulk data == 5. Care Gaps == loop per measure Submitter -> Receiver: $care-gaps Receiver -> Submitter: Bundle (care gap document) end note right: Bulk data @enduml