Skip to content

Commit

Permalink
Add Subject to Measure
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkiel committed Dec 8, 2022
1 parent 2c2d05c commit 3f89e57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/evaluateMeasure.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ func CreateMeasureResource(m data.Measure, measureUrl string, libraryUrl string)
return nil, fmt.Errorf("missing group")
}
measure := fm.Measure{
Url: &measureUrl,
Status: fm.PublicationStatusActive,
Url: &measureUrl,
Status: fm.PublicationStatusActive,
SubjectCodeableConcept: &fm.CodeableConcept{
Coding: []fm.Coding{
createCoding("http://hl7.org/fhir/resource-types", "Patient"),
},
},
Library: []string{libraryUrl},
Scoring: &fm.CodeableConcept{
Coding: []fm.Coding{
Expand Down
2 changes: 2 additions & 0 deletions cmd/evalueMeasure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ func TestCreateMeasureResource(t *testing.T) {

assert.Equal(t, measureUrl, *resource.Url)
assert.Equal(t, fm.PublicationStatusActive, resource.Status)
assert.Equal(t, "http://hl7.org/fhir/resource-types", *resource.SubjectCodeableConcept.Coding[0].System)
assert.Equal(t, "Patient", *resource.SubjectCodeableConcept.Coding[0].Code)
assert.Equal(t, 1, len(resource.Library))
assert.Equal(t, libraryUrl, resource.Library[0])
assert.Equal(t, 1, len(resource.Scoring.Coding))
Expand Down

0 comments on commit 3f89e57

Please sign in to comment.