Skip to content

Commit

Permalink
MAT-6547 address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
adongare committed Feb 26, 2024
1 parent c2bf70a commit 42e108b
Show file tree
Hide file tree
Showing 11 changed files with 272 additions and 230 deletions.
176 changes: 87 additions & 89 deletions src/main/java/gov/cms/madie/hqmf/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,179 +4,177 @@

public interface Generator extends MatConstants {

public static final String HIGH = "high";
String HIGH = "high";

public static final String STOP_DATETIME = "stop datetime";
String STOP_DATETIME = "stop datetime";

public static final String START_DATETIME = "start datetime";
String START_DATETIME = "start datetime";

public static final String FLAVOR_ID = "flavorId";
String FLAVOR_ID = "flavorId";

public static final String LOW = "low";
String LOW = "low";

public static final String EFFECTIVE_TIME = "effectiveTime";
String EFFECTIVE_TIME = "effectiveTime";

public static final String ATTRIBUTE_UUID = "attributeUUID";
String ATTRIBUTE_UUID = "attributeUUID";

public static final String RELATED_TO = "related to";
String RELATED_TO = "related to";

public static final String CHECK_IF_PRESENT = "Check if Present";
String CHECK_IF_PRESENT = "Check if Present";

public static final String TYPE = "type";
String TYPE = "type";

public static final String GROUPING_CHECK = "isInGrouping";
String GROUPING_CHECK = "isInGrouping";

public static final String MOOD = "mood";
String MOOD = "mood";

public static final String CLASS = "class";
String CLASS = "class";

public static final String XSI_TYPE = "xsi:type";
String XSI_TYPE = "xsi:type";

public static final String VALUE = "value";
String VALUE = "value";

public static final String TITLE = "title";
String TITLE = "title";

public static final String DISPLAY_NAME = "displayName";
String DISPLAY_NAME = "displayName";

public static final String CODE_SYSTEM = "codeSystem";
String CODE_SYSTEM = "codeSystem";

public static final String CODE_SYSTEM_NAME = "codeSystemName";
String CODE_SYSTEM_NAME = "codeSystemName";

public static final String CODE_SYSTEM_DISPLAY_NAME = "codeDisplayName";
String CODE_SYSTEM_DISPLAY_NAME = "codeDisplayName";

public static final String ID = "id";
String ID = "id";

public static final String ROOT = "root";
String ROOT = "root";

public static final String ITEM = "item";
String ITEM = "item";

public static final String TEMPLATE_ID = "templateId";
String TEMPLATE_ID = "templateId";

public static final String MOOD_CODE = "moodCode";
String MOOD_CODE = "moodCode";

public static final String CLASS_CODE = "classCode";
String CLASS_CODE = "classCode";

public static final String TYPE_CODE = "typeCode";
String TYPE_CODE = "typeCode";

public static final String RAV = "riskAdjVar";
String RAV = "riskAdjVar";

public static final String OBSERVATION_CRITERIA = "observationCriteria";
String OBSERVATION_CRITERIA = "observationCriteria";

public static final String OUTBOUND_RELATIONSHIP = "outboundRelationship";
String OUTBOUND_RELATIONSHIP = "outboundRelationship";

public static final String UUID = "uuid";
String UUID = "uuid";

public static final String TAXONOMY = "taxonomy";
String TAXONOMY = "taxonomy";

public static final String OID = "oid";
String OID = "oid";

public static final String NAME = "name";
String NAME = "name";

public static final String CODE = "code";
String CODE = "code";

public static final String VERSION_5_0_ID = "2017-05-01";
String VERSION_5_0_ID = "2017-05-01";

public static final String VERSION_4_1_2_ID = "2014-11-24";
String VERSION_4_1_2_ID = "2014-11-24";

public static final String VERSION_4_3_ID = "2015-09-30";
String VERSION_4_3_ID = "2015-09-30";

public static final String POPULATION_CRITERIA_EXTENSION = "2015-12-01";
String POPULATION_CRITERIA_EXTENSION = "2015-12-01";

public static final String POPULATION_CRITERIA_EXTENSION_CQL = "2017-08-01";
String POPULATION_CRITERIA_EXTENSION_CQL = "2017-08-01";

public static final String VALUE_SET = "Value Set";
String VALUE_SET = "Value Set";

public static final String ANATOMICAL_LOCATION_SITE = "Anatomical Location Site";
String ANATOMICAL_LOCATION_SITE = "Anatomical Location Site";

public static final String ANATOMICAL_APPROACH_SITE = "Anatomical Approach Site";
String ANATOMICAL_APPROACH_SITE = "Anatomical Approach Site";

public static final String ORDINALITY = "Ordinality";
String ORDINALITY = "Ordinality";

public static final String LATERALITY = "Laterality";
String LATERALITY = "Laterality";

public static final String ROUTE = "route";
String ROUTE = "route";

public static final String FACILITY_LOCATION = "facility location";
String FACILITY_LOCATION = "facility location";

public static final String FACILITY_LOCATION_ARRIVAL_DATETIME =
"facility location arrival datetime";
String FACILITY_LOCATION_ARRIVAL_DATETIME = "facility location arrival datetime";

public static final String FACILITY_LOCATION_DEPARTURE_DATETIME =
"facility location departure datetime";
String FACILITY_LOCATION_DEPARTURE_DATETIME = "facility location departure datetime";

public static final String REFILLS = "refills";
String REFILLS = "refills";

public static final String CUMULATIVE_MEDICATION_DURATION = "cumulative medication duration";
String CUMULATIVE_MEDICATION_DURATION = "cumulative medication duration";

public static final String FREQUENCY = "frequency";
String FREQUENCY = "frequency";

public static final String ADMISSION_DATETIME = "admission datetime";
String ADMISSION_DATETIME = "admission datetime";

public static final String DISCHARGE_STATUS = "discharge status";
String DISCHARGE_STATUS = "discharge status";

public static final String DISCHARGE_DATETIME = "discharge datetime";
String DISCHARGE_DATETIME = "discharge datetime";

public static final String REMOVAL_DATETIME = "removal datetime";
String REMOVAL_DATETIME = "removal datetime";

public static final String INCISION_DATETIME = "incision datetime";
String INCISION_DATETIME = "incision datetime";

public static final String SIGNED_DATETIME = "signed datetime";
String SIGNED_DATETIME = "signed datetime";

public static final String ACTIVE_DATETIME = "active datetime";
String ACTIVE_DATETIME = "active datetime";

public static final String TIME = "time";
String TIME = "time";

public static final String DATE = "date";
String DATE = "date";

public static final String ATTRIBUTE_MODE = "attributeMode";
String ATTRIBUTE_MODE = "attributeMode";

public static final String ATTRIBUTE_NAME = "attributeName";
String ATTRIBUTE_NAME = "attributeName";

public static final String NEGATION_RATIONALE = "negation rationale";
String NEGATION_RATIONALE = "negation rationale";

public static final String ATTRIBUTE_DATE = "attrDate";
String ATTRIBUTE_DATE = "attrDate";

public final String nameSpace = "http://www.w3.org/2001/XMLSchema-instance";
String nameSpace = "http://www.w3.org/2001/XMLSchema-instance";

public static final String LESS_THAN = "Less Than";
String LESS_THAN = "Less Than";

public static final String GREATER_THAN = "Greater Than";
String GREATER_THAN = "Greater Than";

public static final String EQUAL_TO = "Equal To";
String EQUAL_TO = "Equal To";

public static final String DOSE = "dose";
String DOSE = "dose";

public static final String LENGTH_OF_STAY = "length of stay";
String LENGTH_OF_STAY = "length of stay";

public static final String TRANSLATION = "translation";
String TRANSLATION = "translation";

public static final String NULL_FLAVOR = "nullFlavor";
String NULL_FLAVOR = "nullFlavor";

public static final String RADIATION_DURATION = "radiation duration";
String RADIATION_DURATION = "radiation duration";

public static final String RADIATION_DOSAGE = "radiation dosage";
String RADIATION_DOSAGE = "radiation dosage";

public static final String STATUS_CODE = "statusCode";
String STATUS_CODE = "statusCode";

public static final String ONSET_DATETIME = "onset datetime";
String ONSET_DATETIME = "onset datetime";

public static final String ABATEMENT_DATETIME = "abatement datetime";
String ABATEMENT_DATETIME = "abatement datetime";

public static final String RECORDED_DATETIME = "recorded datetime";
String RECORDED_DATETIME = "recorded datetime";

public static final String REPEAT_NUMBER = "repeatNumber";
String REPEAT_NUMBER = "repeatNumber";

public static final String ONSET_AGE = "Onset Age";
String ONSET_AGE = "Onset Age";

public static final String REFERENCE = "reference";
String REFERENCE = "reference";

public static final String RELATIONSHIP = "relationship";
String RELATIONSHIP = "relationship";

public static final String DIAGNOSIS = "diagnosis";
String DIAGNOSIS = "diagnosis";

public static final String PRINCIPAL_DIAGNOSIS = "principal diagnosis";
String PRINCIPAL_DIAGNOSIS = "principal diagnosis";

public static final String ACTION_NEGATION_IND = "actionNegationInd";
String ACTION_NEGATION_IND = "actionNegationInd";

public String generate(MeasureExport me) throws Exception;
String generate(MeasureExport me) throws Exception;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class HQMFAttributeGenerator extends HQMFDataCriteriaElementGenerator {
private MeasureExport measureExport;

@Override
public String generate(MeasureExport me) throws Exception {
public String generate(MeasureExport measureExport) throws Exception {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class HQMFDataCriteriaElementGenerator implements Generator {

/** The occurrence map. */
private Map<String, Node> occurrenceMap = new HashMap<String, Node>();
private final Map<String, Node> occurrenceMap = new HashMap<String, Node>();

protected String extensionValue = null;

Expand All @@ -36,15 +36,15 @@ public class HQMFDataCriteriaElementGenerator implements Generator {
/**
* Generate hqm for measure.
*
* @param me the me
* @param measureExport- instance of MeasureExport
* @return the string
* @throws Exception the exception
*/
@Override
public String generate(MeasureExport me) throws Exception {
public String generate(MeasureExport measureExport) throws Exception {
String dataCriteria = "";
getExtensionValueBasedOnVersion(me);
dataCriteria = getHQMFXmlString(me);
getExtensionValueBasedOnVersion(measureExport);
dataCriteria = getHQMFXmlString(measureExport);
return dataCriteria;
}

Expand All @@ -64,31 +64,31 @@ public void generateAttributeTagForFunctionalOp(
/**
* Gets the HQMF xml string.
*
* @param me the me
* @param measureExport- an instance of MeasureExport
* @return the HQMF xml string
*/
private String getHQMFXmlString(MeasureExport me) {
XmlProcessor dataCriteriaXMLProcessor = createDateCriteriaTemplate(me);
me.setHqmfXmlProcessor(dataCriteriaXMLProcessor);
private String getHQMFXmlString(MeasureExport measureExport) {
XmlProcessor dataCriteriaXMLProcessor = createDateCriteriaTemplate(measureExport);
measureExport.setHqmfXmlProcessor(dataCriteriaXMLProcessor);

String simpleXMLStr = me.getSimpleXml();
String simpleXMLStr = measureExport.getSimpleXml();
XmlProcessor simpleXmlprocessor = new XmlProcessor(simpleXMLStr);
me.setSimpleXmlProcessor(simpleXmlprocessor);
measureExport.setSimpleXmlProcessor(simpleXmlprocessor);

prepHQMF(me);
prepHQMF(measureExport);

createDataCriteriaForQDMELements(me, dataCriteriaXMLProcessor, simpleXmlprocessor);
createDataCriteriaForQDMELements(measureExport, dataCriteriaXMLProcessor, simpleXmlprocessor);
addDataCriteriaComment(dataCriteriaXMLProcessor);
return dataCriteriaXMLProcessor.transform(dataCriteriaXMLProcessor.getOriginalDoc(), true);
}

/**
* Creates the date criteria template.
*
* @param me the me
* @param measureExport- an instance of MeasureExport
* @return the string
*/
private XmlProcessor createDateCriteriaTemplate(MeasureExport me) {
private XmlProcessor createDateCriteriaTemplate(MeasureExport measureExport) {
XmlProcessor outputProcessor =
new XmlProcessor(
"<root><component><dataCriteriaSection></dataCriteriaSection></component></root>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public class HQMFClauseLogicGenerator implements Generator {
}

@Override
public String generate(MeasureExport me) throws Exception {
measureExport = me;
public String generate(MeasureExport measureExport) throws Exception {
this.measureExport = measureExport;
createUsedSubTreeRefMap();
generateSubTreeXML();
return null;
Expand Down
Loading

0 comments on commit 42e108b

Please sign in to comment.