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

Linting run over once, pushing up for review. #3

Open
wants to merge 2 commits into
base: fhir-r4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class BundleRequest {

private final static Logger logger = LoggerFactory.getLogger(BundleRequest.class);
private static final Logger logger = LoggerFactory.getLogger(BundleRequest.class);

/**
* Reads the configuration file, and parses out any overriding OIDs.
Expand Down Expand Up @@ -56,8 +56,8 @@ public static String generateIfNoneExist(BundleEntryComponent bundleEntry) {
// find any overriding OIDs.
String[] subsetOIDArray = getDefinedOIDs(bundleEntry.getResource().getResourceType().name());

if (bundleEntry.getResource().getResourceType().name() != "Medication"
&& bundleEntry.getResource().getResourceType().name() != "PractitionerRole") {
if (bundleEntry.getResource().getResourceType().name().equals("Medication") == false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another way of doing this is if(!bundleEntry.getResource().getResourceType().name().equals("Medication"))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I mostly just wanted it to be explicit what the intent of the statement was without having to add comments to the code.

&& bundleEntry.getResource().getResourceType().name().equals("PractitionerRole") == false) {
if (identifierObject != null) {
List<Base> identifiers = identifierObject.getValues();
if (identifiers != null) {
Expand All @@ -70,7 +70,7 @@ public static String generateIfNoneExist(BundleEntryComponent bundleEntry) {
// override OID selection(s).
for (String OID : subsetOIDArray) {
if (currentId.getSystem().equals(OID)) {
if (ifNotExistString != "") {
if (ifNotExistString.equals("") == false) {
ifNotExistString = ifNotExistString + ",";
} else {
ifNotExistString = "identifier=";
Expand All @@ -80,7 +80,7 @@ public static String generateIfNoneExist(BundleEntryComponent bundleEntry) {
}
}
} else {
if (ifNotExistString != "") {
if (ifNotExistString.equals("") == false) {
ifNotExistString = ifNotExistString + ",";
} else {
ifNotExistString = "identifier=";
Expand All @@ -99,9 +99,9 @@ public static String generateIfNoneExist(BundleEntryComponent bundleEntry) {
}

// if we can't pull an identifier, try other logic.
if (ifNotExistString == "") {
if (ifNotExistString.equals("")) {
// if it's a medication, check by aggregate encodings.
if (bundleEntry.getResource().getResourceType().name() == "Medication") {
if (bundleEntry.getResource().getResourceType().name().equals("Medication")) {
Property medicationCode = bundleEntry.getResource().getChildByName("code");
if (medicationCode != null) {
List<Base> conceptList = medicationCode.getValues();
Expand All @@ -112,9 +112,9 @@ public static String generateIfNoneExist(BundleEntryComponent bundleEntry) {

if (Config.MEDICATION_CODE_SYSTEM != null) {
if (coding.getCode() != null) {
if (coding.getSystem() == Config.MEDICATION_CODE_SYSTEM) {
if (coding.getSystem().equals(Config.MEDICATION_CODE_SYSTEM)) {
// add or for multiple parameters
if (ifNotExistString != "") {
if (ifNotExistString.equals("") == false) {
ifNotExistString = ifNotExistString + "&";
} else {
ifNotExistString = "code=";
Expand All @@ -126,7 +126,7 @@ public static String generateIfNoneExist(BundleEntryComponent bundleEntry) {
} else {
if (coding.getCode() != null) {
// add or for multiple parameters
if (ifNotExistString != "") {
if (ifNotExistString.equals("") == false) {
ifNotExistString = ifNotExistString + "&";
} else {
ifNotExistString = "code=";
Expand All @@ -140,11 +140,11 @@ public static String generateIfNoneExist(BundleEntryComponent bundleEntry) {
}

// if it's a practitioner role, de-duplicate by reference ids.
if (bundleEntry.getResource().getResourceType().name() == "PractitionerRole") {
if (bundleEntry.getResource().getResourceType().name().equals("PractitionerRole")) {
PractitionerRole practitionerRole = (PractitionerRole) bundleEntry.getResource();
Identifier practitionerIdentifier = practitionerRole.getPractitionerTarget().getIdentifierFirstRep();
Identifier organizationIdentifier = practitionerRole.getOrganizationTarget().getIdentifierFirstRep();
if (organizationIdentifier != null & practitionerIdentifier != null) {
if (organizationIdentifier != null && practitionerIdentifier != null) {
ifNotExistString = "practitioner.identifier=" + practitionerIdentifier.getSystem() + "|"
+ practitionerIdentifier.getValue();
ifNotExistString = ifNotExistString + "&" + "organization.identifier="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import org.hl7.fhir.r4.model.Observation.ObservationReferenceRangeComponent;
import org.hl7.fhir.r4.model.Range;
import org.hl7.fhir.r4.model.SimpleQuantity;
import org.junit.Assert;
import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_PQ;
import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_PQ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.math.BigDecimal;

import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.SimpleQuantity;
import org.junit.Assert;
import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_PQ;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.math.BigDecimal;

import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.SimpleQuantity;
import org.junit.Assert;
import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_PQ;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.PractitionerRole;
import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.SimpleQuantity;
import org.hl7.fhir.r4.model.Timing;
import org.junit.Assert;
import org.openhealthtools.mdht.uml.cda.Author;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Medication;
import org.hl7.fhir.r4.model.MedicationDispense;
import org.hl7.fhir.r4.model.SimpleQuantity;
import org.junit.Assert;
import org.openhealthtools.mdht.uml.cda.ManufacturedProduct;
import org.openhealthtools.mdht.uml.cda.Performer2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.hl7.fhir.r4.model.Period;
import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.PractitionerRole;
import org.hl7.fhir.r4.model.SimpleQuantity;
import org.junit.Assert;
import org.openhealthtools.mdht.uml.cda.Act;
import org.openhealthtools.mdht.uml.cda.Author;
Expand Down