Skip to content

Commit

Permalink
Merge pull request #2242 from IBM/issue-2241
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
  • Loading branch information
lmsurpre authored Apr 13, 2021
2 parents d9e8bd5 + 2ed6cea commit af9d6d5
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 566 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2016, 2020
* (C) Copyright IBM Corp. 2016, 2021
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -91,8 +91,10 @@ private boolean isValid(FHIROperation operation) throws FHIRValidationException,
List<Issue> issues = FHIRValidator.validator().validate(opDef);
if (!issues.isEmpty()) {
for (Issue issue : issues) {
log.info("Issue: " + issue.getCode().getValue() + ":"
+ issue.getSeverity().getValue() + ":" + issue.getDetails().getText().getValue());
if (log.isLoggable(Level.FINE)) {
log.fine("Issue: " + issue.getCode().getValue() + ":"
+ issue.getSeverity().getValue() + ":" + issue.getDetails().getText().getValue());
}
if (issue.getSeverity().equals(IssueSeverity.ERROR)
|| issue.getSeverity().equals(IssueSeverity.FATAL)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2017, 2020
* (C) Copyright IBM Corp. 2017, 2021
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -8,16 +8,13 @@

import static com.ibm.fhir.model.type.String.string;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import javax.ws.rs.core.MultivaluedMap;

import com.ibm.fhir.exception.FHIROperationException;
import com.ibm.fhir.model.format.Format;
import com.ibm.fhir.model.parser.FHIRParser;
import com.ibm.fhir.model.resource.ActivityDefinition;
import com.ibm.fhir.model.resource.CarePlan;
import com.ibm.fhir.model.resource.CarePlan.Activity.Detail;
Expand Down Expand Up @@ -60,8 +57,6 @@
*/
public class ApplyOperation extends AbstractOperation {

private static final String FILE = "apply.json";

private static final String PARAM_PLAN_DEFINITION = "planDefinition";
private static final String PARAM_SUBJECT = "subject";
private static final String PARAM_ENCOUNTER = "encounter";
Expand All @@ -78,11 +73,8 @@ public class ApplyOperation extends AbstractOperation {

@Override
protected OperationDefinition buildOperationDefinition() {
try (InputStream in = getClass().getClassLoader().getResourceAsStream(FILE);) {
return FHIRParser.parser(Format.JSON).parse(in);
} catch (Exception e) {
throw new Error(e);
}
return FHIRRegistry.getInstance().getResource("http://hl7.org/fhir/OperationDefinition/PlanDefinition-apply",
OperationDefinition.class);
}

@Override
Expand Down
132 changes: 0 additions & 132 deletions operation/fhir-operation-apply/src/main/resources/apply.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
/*
* (C) Copyright IBM Corp. 2020
* (C) Copyright IBM Corp. 2020, 2021
*
* SPDX-License-Identifier: Apache-2.0
*/

package com.ibm.fhir.operation.convert;

import java.io.InputStream;

import com.ibm.fhir.exception.FHIROperationException;
import com.ibm.fhir.model.format.Format;
import com.ibm.fhir.model.parser.FHIRParser;
import com.ibm.fhir.model.resource.OperationDefinition;
import com.ibm.fhir.model.resource.Parameters;
import com.ibm.fhir.model.resource.Parameters.Parameter;
import com.ibm.fhir.model.resource.Resource;
import com.ibm.fhir.model.type.code.IssueType;
import com.ibm.fhir.registry.FHIRRegistry;
import com.ibm.fhir.server.operation.spi.AbstractOperation;
import com.ibm.fhir.server.operation.spi.FHIROperationContext;
import com.ibm.fhir.server.operation.spi.FHIRResourceHelpers;
import com.ibm.fhir.server.util.FHIROperationUtil;

public class ConvertOperation extends AbstractOperation {
public ConvertOperation() {
super();
}

@Override
protected OperationDefinition buildOperationDefinition() {
try (InputStream in = getClass().getClassLoader().getResourceAsStream("convert.json");){
return FHIRParser.parser(Format.JSON).parse(in);
} catch (Exception e) {
throw new Error(e);
}
return FHIRRegistry.getInstance().getResource("http://hl7.org/fhir/OperationDefinition/Resource-convert",
OperationDefinition.class);
}

@Override
Expand Down
69 changes: 0 additions & 69 deletions operation/fhir-operation-convert/src/main/resources/convert.json

This file was deleted.

Loading

0 comments on commit af9d6d5

Please sign in to comment.