Skip to content

Commit

Permalink
Merge pull request #159 from MeasureAuthoringTool/feature/MAT-6138-re…
Browse files Browse the repository at this point in the history
…move-HAPI-client

Feature/mat 6138 remove hapi client
  • Loading branch information
nmorasb authored Sep 20, 2023
2 parents 491b698 + 6a8eda3 commit 9c8b694
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 393 deletions.
119 changes: 0 additions & 119 deletions src/main/java/gov/cms/madie/madiefhirservice/hapi/HapiFhirServer.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -65,39 +65,6 @@ public ResponseEntity<String> getMeasureBundle(
.body(fhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle));
}

@PostMapping(value = "/save", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> saveMeasure(
HttpServletRequest request,
@RequestHeader("Authorization") String accessToken,
@RequestBody @Validated(Measure.ValidationSequence.class) Measure measure) {
log.debug("Entering saveMeasure()");

Bundle bundle =
measureBundleService.createMeasureBundle(
measure,
request.getUserPrincipal(),
BundleUtil.MEASURE_BUNDLE_TYPE_EXPORT,
accessToken);
bundle.setType(Bundle.BundleType.DOCUMENT);
String serialized =
fhirContext.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle);
MethodOutcome outcome = measureBundleService.saveMeasureBundle(serialized);

if (outcome != null && outcome.getCreated()) {
log.debug(
"Successfully saved MADiE measure in HAPI FHIR. MADiE measure id = "
+ measure.getId()
+ " HAPI FHIR id = "
+ outcome.getId().toString());
return ResponseEntity.status(HttpStatus.CREATED).body(outcome.getId().toString());
} else {
String errorMsg =
"Error saving versioned measure in HAPI FHIR! MADiE measure id = " + measure.getId();
log.error(errorMsg);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMsg);
}
}

@PutMapping(
value = "/export",
produces = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
@Service
@RequiredArgsConstructor
public class HumanReadableService extends ResourceUtils {


private final LiquidEngine liquidEngine;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gov.cms.madie.madiefhirservice.services;

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;
Expand All @@ -23,8 +22,6 @@
import org.hl7.fhir.r4.model.Resource;
import org.springframework.stereotype.Service;

import ca.uhn.fhir.rest.api.MethodOutcome;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -37,7 +34,6 @@ public class MeasureBundleService {
private final MeasureTranslatorService measureTranslatorService;
private final LibraryTranslatorService libraryTranslatorService;
private final LibraryService libraryService;
private final HapiFhirServer hapiFhirServer;
private final ElmTranslatorClient elmTranslatorClient;
private final HumanReadableService humanReadableService;

Expand Down Expand Up @@ -149,10 +145,6 @@ public CqlLibrary createCqlLibraryForMadieMeasure(Measure madieMeasure) {
.build();
}

public MethodOutcome saveMeasureBundle(String measureBundle) {
return hapiFhirServer.createResourceAsString(measureBundle);
}

private void setNarrativeText(DomainResource resource, String humanReadable) {
Narrative narrative = new Narrative();
narrative.setStatus(Narrative.NarrativeStatus.EXTENSIONS);
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ server:
servlet:
context-path: /api

hapi:
fhir:
url: ${HAPI_FHIR_URL:http://localhost:8080/fhir}

fhir-base-url: ${FHIR_BASE_URL:http://ecqi.healthit.gov/ecqms}

madie:
Expand Down

This file was deleted.

Loading

0 comments on commit 9c8b694

Please sign in to comment.