Skip to content

Commit

Permalink
Merge pull request #11 from MeasureAuthoringTool/feature/mat-7190-qrd…
Browse files Browse the repository at this point in the history
…a-content-corrections

[MAT-7190] Set HQMF ID and Display Data Element ID's as simple strings
  • Loading branch information
jkotanchik-SB authored May 15, 2024
2 parents abe737d + 73e5350 commit 551db39
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions model/mongoid.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Override the as_json method to ensure the _id is displayed as
# just the _id value as a string in the QRDA XML, "<_id>".
# Without this override it will be serialized as extended
# BSON::JSON, "{$oid => "<_id>"}"
module BSON
class ObjectId
def as_json(*args)
to_s.as_json
end
end
end
8 changes: 7 additions & 1 deletion service/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
access_token = request.env["HTTP_Authorization"]
measure_dto = request.params

measure = CQM::Measure.new(JSON.parse(measure_dto["measure"]))
madie_measure = JSON.parse(measure_dto["measure"])
measure = CQM::Measure.new(madie_measure) unless madie_measure.nil?
if measure.nil?
return [400, "Measure is empty."]
end

test_cases = measure_dto["testCases"]
source_data_criteria = measure_dto["sourceDataCriteria"]

Expand All @@ -59,6 +64,7 @@

measure.source_data_criteria = data_criteria
measure.cms_id = measure.cms_id.nil? ? 'CMS0v0' : measure.cms_id
measure.hqmf_id = madie_measure["id"]

qrda_errors = {}
html_errors = {}
Expand Down

0 comments on commit 551db39

Please sign in to comment.