cleanup
This commit is contained in:
parent
a881ce620c
commit
4f48bce959
|
@ -20,8 +20,6 @@
|
|||
package ca.uhn.hapi.fhir.cdshooks.svc.cr;
|
||||
|
||||
public class CdsCrConstants {
|
||||
private CdsCrConstants() {}
|
||||
|
||||
public static final String CDS_CR_MODULE_ID = "CR";
|
||||
|
||||
public static final String CRMI_EFFECTIVE_DATA_REQUIREMENTS =
|
||||
|
|
|
@ -185,14 +185,14 @@ public class PrefetchTemplateBuilderDstu3 extends BasePrefetchTemplateBuilder {
|
|||
}
|
||||
|
||||
protected StringBuilder getCodesStringBuilder(
|
||||
List<String> theList, StringBuilder theCodes, String theSystem, String theCode) {
|
||||
List<String> theStrings, StringBuilder theCodes, String theSystem, String theCode) {
|
||||
String codeToken = theSystem + "|" + theCode;
|
||||
int postAppendLength = theCodes.length() + codeToken.length();
|
||||
|
||||
if (theCodes.length() > 0 && postAppendLength < myMaxUriLength) {
|
||||
theCodes.append(",");
|
||||
} else if (postAppendLength > myMaxUriLength) {
|
||||
theList.add(theCodes.toString());
|
||||
theStrings.add(theCodes.toString());
|
||||
theCodes = new StringBuilder();
|
||||
}
|
||||
theCodes.append(codeToken);
|
||||
|
@ -427,8 +427,9 @@ public class PrefetchTemplateBuilderDstu3 extends BasePrefetchTemplateBuilder {
|
|||
return "subject";
|
||||
case "VisionPrescription":
|
||||
return "patient";
|
||||
}
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,11 +127,11 @@ public class PrefetchTemplateBuilderR4 extends BasePrefetchTemplateBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
protected List<String> resolveValueCodingCodes(List<Coding> valueCodings) {
|
||||
protected List<String> resolveValueCodingCodes(List<Coding> theValueCodings) {
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
StringBuilder codes = new StringBuilder();
|
||||
for (Coding coding : valueCodings) {
|
||||
for (Coding coding : theValueCodings) {
|
||||
if (coding.hasCode()) {
|
||||
String system = coding.getSystem();
|
||||
String code = coding.getCode();
|
||||
|
@ -144,8 +144,8 @@ public class PrefetchTemplateBuilderR4 extends BasePrefetchTemplateBuilder {
|
|||
return result;
|
||||
}
|
||||
|
||||
protected List<String> resolveValueSetCodes(CanonicalType valueSetId) {
|
||||
ValueSet valueSet = (ValueSet) SearchHelper.searchRepositoryByCanonical(myRepository, valueSetId);
|
||||
protected List<String> resolveValueSetCodes(CanonicalType theValueSetId) {
|
||||
ValueSet valueSet = (ValueSet) SearchHelper.searchRepositoryByCanonical(myRepository, theValueSetId);
|
||||
List<String> result = new ArrayList<>();
|
||||
StringBuilder codes = new StringBuilder();
|
||||
if (valueSet.hasExpansion() && valueSet.getExpansion().hasContains()) {
|
||||
|
@ -172,18 +172,19 @@ public class PrefetchTemplateBuilderR4 extends BasePrefetchTemplateBuilder {
|
|||
return result;
|
||||
}
|
||||
|
||||
protected StringBuilder getCodesStringBuilder(List<String> ret, StringBuilder codes, String system, String code) {
|
||||
String codeToken = system + "|" + code;
|
||||
int postAppendLength = codes.length() + codeToken.length();
|
||||
protected StringBuilder getCodesStringBuilder(
|
||||
List<String> theStrings, StringBuilder theCodes, String system, String theCode) {
|
||||
String codeToken = system + "|" + theCode;
|
||||
int postAppendLength = theCodes.length() + codeToken.length();
|
||||
|
||||
if (codes.length() > 0 && postAppendLength < myMaxUriLength) {
|
||||
codes.append(",");
|
||||
if (theCodes.length() > 0 && postAppendLength < myMaxUriLength) {
|
||||
theCodes.append(",");
|
||||
} else if (postAppendLength > myMaxUriLength) {
|
||||
ret.add(codes.toString());
|
||||
codes = new StringBuilder();
|
||||
theStrings.add(theCodes.toString());
|
||||
theCodes = new StringBuilder();
|
||||
}
|
||||
codes.append(codeToken);
|
||||
return codes;
|
||||
theCodes.append(codeToken);
|
||||
return theCodes;
|
||||
}
|
||||
|
||||
protected String mapCodePathToSearchParam(String theDataType, String thePath) {
|
||||
|
@ -406,8 +407,9 @@ public class PrefetchTemplateBuilderR4 extends BasePrefetchTemplateBuilder {
|
|||
return "subject";
|
||||
case "VisionPrescription":
|
||||
return "patient";
|
||||
}
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,14 +174,14 @@ public class PrefetchTemplateBuilderR5 extends BasePrefetchTemplateBuilder {
|
|||
}
|
||||
|
||||
protected StringBuilder getCodesStringBuilder(
|
||||
List<String> theList, StringBuilder theCodes, String theSystem, String theCode) {
|
||||
List<String> theStrings, StringBuilder theCodes, String theSystem, String theCode) {
|
||||
String codeToken = theSystem + "|" + theCode;
|
||||
int postAppendLength = theCodes.length() + codeToken.length();
|
||||
|
||||
if (theCodes.length() > 0 && postAppendLength < myMaxUriLength) {
|
||||
theCodes.append(",");
|
||||
} else if (postAppendLength > myMaxUriLength) {
|
||||
theList.add(theCodes.toString());
|
||||
theStrings.add(theCodes.toString());
|
||||
theCodes = new StringBuilder();
|
||||
}
|
||||
theCodes.append(codeToken);
|
||||
|
@ -414,8 +414,9 @@ public class PrefetchTemplateBuilderR5 extends BasePrefetchTemplateBuilder {
|
|||
return "subject";
|
||||
case "VisionPrescription":
|
||||
return "patient";
|
||||
}
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue