diff --git a/src/main/java/gov/cms/madie/madiefhirservice/services/LibraryTranslatorService.java b/src/main/java/gov/cms/madie/madiefhirservice/services/LibraryTranslatorService.java index 2d1ed1c2..f59b1fc4 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/services/LibraryTranslatorService.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/services/LibraryTranslatorService.java @@ -49,7 +49,7 @@ public LibraryTranslatorService(LibraryCqlVisitorFactory libCqlVisitorFactory) { public Library convertToFhirLibrary(CqlLibrary cqlLibrary) { var visitor = libCqlVisitorFactory.visit(cqlLibrary.getCql()); Library library = new Library(); - library.setId(cqlLibrary.getId()); + library.setId(cqlLibrary.getCqlLibraryName()); library.setLanguage("en"); library.setName(cqlLibrary.getCqlLibraryName()); library.setVersion(cqlLibrary.getVersion().toString()); @@ -75,9 +75,6 @@ public Library convertToFhirLibrary(CqlLibrary cqlLibrary) { identifier.setSystem("https://madie.cms.gov/login"); identifier.setValue(cqlLibrary.getId()); library.setIdentifier(List.of(identifier)); - - // TODO: probably have to revisit this. Human Readable feature is not yet ready - // result.setText(findHumanReadable(lib.getMeasureId())); return library; } diff --git a/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureBundleService.java b/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureBundleService.java index e479f979..e6b617f7 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureBundleService.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureBundleService.java @@ -3,6 +3,7 @@ import gov.cms.madie.madiefhirservice.constants.UriConstants; import gov.cms.madie.madiefhirservice.hapi.HapiFhirServer; import gov.cms.madie.madiefhirservice.utils.BundleUtil; +import gov.cms.madie.madiefhirservice.utils.FhirResourceHelpers; import gov.cms.madie.madiefhirservice.utils.ResourceUtils; import gov.cms.madie.models.library.CqlLibrary; import gov.cms.madie.models.measure.Measure; @@ -108,7 +109,14 @@ public List createBundleComponentsForLibrariesOfMad /** Creates BundleEntryComponent for given resource */ public Bundle.BundleEntryComponent getBundleEntryComponent(Resource resource) { - return new Bundle.BundleEntryComponent().setResource(resource); + Bundle.BundleEntryRequestComponent requestComponent = + new Bundle.BundleEntryRequestComponent() + .setMethod(Bundle.HTTPVerb.PUT) + .setUrl(resource.getResourceType() + "/" + resource.getIdPart()); + return new Bundle.BundleEntryComponent() + .setFullUrl(FhirResourceHelpers.getFullUrl(resource)) + .setResource(resource) + .setRequest(requestComponent); } /** diff --git a/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorService.java b/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorService.java index a36700f0..33a29a15 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorService.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/services/MeasureTranslatorService.java @@ -59,7 +59,7 @@ public org.hl7.fhir.r4.model.Measure createFhirMeasureForMadieMeasure(Measure ma .setTitle(madieMeasure.getMeasureName()) .setIdentifier(buildMeasureIdentifiers(madieMeasure)) .setExperimental(madieMeasure.getMeasureMetaData().isExperimental()) - .setUrl(FhirResourceHelpers.buildMeasureUrl(madieMeasure)) + .setUrl(FhirResourceHelpers.buildMeasureUrl(madieMeasure.getCqlLibraryName())) .setVersion(madieMeasure.getVersion().toString()) .setEffectivePeriod( getPeriodFromDates( @@ -75,7 +75,8 @@ public org.hl7.fhir.r4.model.Measure createFhirMeasureForMadieMeasure(Measure ma .setRationale(rationale) .setLibrary( Collections.singletonList( - new CanonicalType(FhirResourceHelpers.buildLibraryUrl(madieMeasure)))) + new CanonicalType( + FhirResourceHelpers.buildLibraryUrl(madieMeasure.getCqlLibraryName())))) .setPurpose(UNKNOWN) .setContact(buildContactDetail(madieMeasure.getMeasureMetaData().getSteward(), false)) .setGroup(buildGroups(madieMeasure.getGroups())) @@ -90,7 +91,8 @@ public org.hl7.fhir.r4.model.Measure createFhirMeasureForMadieMeasure(Measure ma .setClinicalRecommendationStatement( madieMeasure.getMeasureMetaData().getClinicalRecommendation()) .setDate(Date.from(madieMeasure.getLastModifiedAt())) - .setMeta(buildMeasureMeta()); + .setMeta(buildMeasureMeta()) + .setId(madieMeasure.getCqlLibraryName()); for (Extension ext : buildExtensions(madieMeasure)) { measure.addExtension(ext); diff --git a/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java b/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java index 543ad0bb..c9099132 100644 --- a/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java +++ b/src/main/java/gov/cms/madie/madiefhirservice/services/TestCaseBundleService.java @@ -73,10 +73,7 @@ public Map getTestCaseExportBundle(Measure measure, List