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

Feature/mat 6138 remove hapi client #159

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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
Loading