Skip to content
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

support instance resources in referred library or in another expressi… #133

Merged
merged 4 commits into from
Aug 11, 2022

Conversation

mdnazmulkarim
Copy link
Contributor

@mdnazmulkarim mdnazmulkarim commented Aug 9, 2022

We are inspecting Instance element in cql. The cons is it will add execution overhead.

define "SDEResourceConstructionTest":
  SDE."Resource Construction Test"
  
define "SDEResourceConstructionTestInlib":
  "Resource Construction Test Inlib"  
  
define "Resource Construction Test Inlib":
  FHIR.Observation {
    id: FHIR.id { id: 'observation-sdetest-' + ToString(Now()) },
    status: FHIR.ObservationStatus { value: 'final' },
    code: FHIR.CodeableConcept { coding: { FHIR.Coding { code: FHIR.code { value: 'days-since-appointment' } } } },
    subject: FHIR.Reference { reference: FHIR.string { value: Patient.id.value }},
    value: FHIR.integer { value: Abs(difference in days between end of SDE."Last Appointment".period and ToDateTime(Today())) }
  }  

SDE:

define "Resource Construction Test":
  FHIR.Observation {
    // id: FHIR.id { id: 'observation-sdetest-' + ReplaceMatches(ToString(Now()), ':', '') },
    id: FHIR.id { id: 'observation-sdetest-' + ToString(Now()) },
    status: FHIR.ObservationStatus { value: 'final' },
    code: FHIR.CodeableConcept { coding: { FHIR.Coding { code: FHIR.code { value: 'days-since-appointment' } } } },
    subject: FHIR.Reference { reference: FHIR.string { value: Patient.id.value }},
    value: FHIR.integer { value: Abs(difference in days between end of "Last Appointment".period and ToDateTime(Today())) }
  }

@mdnazmulkarim mdnazmulkarim marked this pull request as ready for review August 9, 2022 00:16
@@ -437,8 +439,21 @@ protected void evaluateSdes(List<SdeDef> sdes) {

// consider more complex expression in future
private void inspectInstanceEvaluation(SdeDef sdeDef, ExpressionDef expressionDef) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we need to do inspection of the resources or of the ExpressionType. Why is getEvaluatedResources not enough to distinguish between constructed and retrieved resources?

Copy link

@rob-reynolds rob-reynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally.

Tests passed.

LGTM

@rob-reynolds rob-reynolds merged commit 5519615 into master Aug 11, 2022
@rob-reynolds rob-reynolds deleted the handle-instance-resource-func-ref branch August 11, 2022 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants