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

MAT-6547: initial pass at HQMF generator code from the MAT #7

Merged
merged 23 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3fce6b3
MAT-6547: initial pass at HQMF generator code from the MAT
nmorasb Feb 2, 2024
78e0cd7
MAT-6547: refactors and slight test coverage
nmorasb Feb 5, 2024
4bebc73
MAT-6547: formatting changes
nmorasb Feb 20, 2024
edf7dfa
MAT-6547: formatting changes, merge down develop, changes to appease …
nmorasb Feb 21, 2024
861aa2b
MAT-6547: address PR comment
nmorasb Feb 21, 2024
d1dd8a2
MAT-6547: refactor HQMF generation to separate service that generates…
nmorasb Feb 21, 2024
d41465f
MAT-6547: update XSD to account for cqldefinition vs aggregate functi…
nmorasb Feb 21, 2024
034312a
Merge branch 'develop' into feature/MAT-6547-hqmf-generator
adongare Feb 22, 2024
3c9f4d0
MAT-6547 fix snyk violations for content type
adongare Feb 22, 2024
507ec05
MAT-6547 set response content type
adongare Feb 22, 2024
006450c
MAT-6547 fix response content type violation
adongare Feb 22, 2024
05f3a81
MAT-6547 fix snyk violations
adongare Feb 22, 2024
4971526
MAT-6547 snyk violation, set content type
adongare Feb 22, 2024
ba88d99
MAT-6547 set content type header
adongare Feb 22, 2024
76e46a4
MAT-6547 set content type
adongare Feb 22, 2024
0be2e47
MAT-6547 XSS fix
adongare Feb 22, 2024
fe098c9
MAT-6547 xss fix
adongare Feb 23, 2024
a939ddd
MAT-6547 XSS fix
adongare Feb 23, 2024
7e399e7
MAT-6547 XSS attack fix
adongare Feb 23, 2024
53d25a6
MAT-6547 XSS fix
adongare Feb 23, 2024
56178c1
MAT-6547 revert the content type change
adongare Feb 23, 2024
c2bf70a
MAT-6547 address PR feedback
adongare Feb 26, 2024
42e108b
MAT-6547 address PR feedback
adongare Feb 26, 2024
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
2 changes: 1 addition & 1 deletion madie-checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- https://checkstyle.sourceforge.io/config_sizes.html#FileLength -->
<module name="FileLength">
<property name="max" value="605" />
<property name="max" value="1000" />
</module>
<module name="SuppressionFilter">
<property name="file" value="suppressions.xml"/>
Expand Down
15 changes: 13 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<mvnreports.version>3.2.2</mvnreports.version>
<mvnsite.version>3.11.0</mvnsite.version>
<okta.springboot.starter.version>3.0.5</okta.springboot.starter.version>

<org.mapstruct.version>1.5.5.Final</org.mapstruct.version>
<puppycrawl.checkstyle.version>10.1</puppycrawl.checkstyle.version>
<spotify.fmt.version>2.21.1</spotify.fmt.version>
Expand Down Expand Up @@ -75,7 +74,17 @@
<artifactId>packaging-utility</artifactId>
<version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
</dependency>

<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>12.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
Expand All @@ -87,6 +96,7 @@
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -97,7 +107,6 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
<repositories>
<repository>
Expand Down Expand Up @@ -233,9 +242,11 @@
<targetJdk>${java.version}</targetJdk>
<excludes>
<exclude>**/generated/**/*</exclude>
<exclude>**/madie/hqmf/**/*</exclude>
</excludes>
<excludeRoots>
<excludeRoot>${project.basedir}/src/main/java/generated</excludeRoot>
<excludeRoot>${project.basedir}/src/main/java/gov/cms/madie/hqmf</excludeRoot>
</excludeRoots>
</configuration>
<executions>
Expand Down
47 changes: 22 additions & 25 deletions src/main/java/generated/gov/cms/madie/simplexml/ClauseType.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@

package generated.gov.cms.madie.simplexml;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElementRef;
import jakarta.xml.bind.annotation.XmlElementRefs;
import jakarta.xml.bind.annotation.XmlMixed;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElements;
import jakarta.xml.bind.annotation.XmlType;

/**
Expand All @@ -27,9 +24,11 @@
* <complexType name="clauseType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="cqldefinition" type="{}cqldefinitionType" minOccurs="0"/>
* <element name="cqlaggfunction" type="{}cqlaggfunctionType" minOccurs="0"/>
* <sequence maxOccurs="unbounded" minOccurs="0">
* <choice>
* <element name="cqldefinition" type="{}cqldefinitionType" minOccurs="0"/>
* <element name="cqlaggfunction" type="{}cqlaggfunctionType" minOccurs="0"/>
* </choice>
* </sequence>
* <attribute name="displayName" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="isInGrouping" type="{http://www.w3.org/2001/XMLSchema}string" />
Expand All @@ -43,15 +42,14 @@
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "clauseType",
propOrder = {"content"})
propOrder = {"cqldefinitionOrCqlaggfunction"})
public class ClauseType {

@XmlElementRefs({
@XmlElementRef(name = "cqldefinition", type = JAXBElement.class, required = false),
@XmlElementRef(name = "cqlaggfunction", type = JAXBElement.class, required = false)
@XmlElements({
@XmlElement(name = "cqldefinition", type = CqldefinitionType.class),
@XmlElement(name = "cqlaggfunction", type = CqlaggfunctionType.class)
})
@XmlMixed
protected List<Serializable> content;
protected List<Object> cqldefinitionOrCqlaggfunction;

@XmlAttribute(name = "displayName")
protected String displayName;
Expand All @@ -66,29 +64,28 @@ public class ClauseType {
protected String uuid;

/**
* Gets the value of the content property.
* Gets the value of the cqldefinitionOrCqlaggfunction property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the content property.
* there is not a <CODE>set</CODE> method for the cqldefinitionOrCqlaggfunction property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getContent().add(newItem);
* getCqldefinitionOrCqlaggfunction().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link JAXBElement }{@code <}{@link
* CqlaggfunctionType }{@code >} {@link JAXBElement }{@code <}{@link CqldefinitionType }{@code >}
* {@link String }
* <p>Objects of the following type(s) are allowed in the list {@link CqlaggfunctionType } {@link
* CqldefinitionType }
*
* @return The value of the content property.
* @return The value of the cqldefinitionOrCqlaggfunction property.
*/
public List<Serializable> getContent() {
if (content == null) {
content = new ArrayList<>();
public List<Object> getCqldefinitionOrCqlaggfunction() {
if (cqldefinitionOrCqlaggfunction == null) {
cqldefinitionOrCqlaggfunction = new ArrayList<>();
}
return this.content;
return this.cqldefinitionOrCqlaggfunction;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
public class ObjectFactory {

private static final QName _Measure_QNAME = new QName("", "measure");
private static final QName _ClauseTypeCqldefinition_QNAME = new QName("", "cqldefinition");
private static final QName _ClauseTypeCqlaggfunction_QNAME = new QName("", "cqlaggfunction");

/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes
Expand Down Expand Up @@ -430,28 +428,4 @@ public MeasureDetailsType createMeasureDetailsType() {
public JAXBElement<MeasureType> createMeasure(MeasureType value) {
return new JAXBElement<>(_Measure_QNAME, MeasureType.class, null, value);
}

/**
* Create an instance of {@link JAXBElement }{@code <}{@link CqldefinitionType }{@code >}
*
* @param value Java instance representing xml element's value.
* @return the new instance of {@link JAXBElement }{@code <}{@link CqldefinitionType }{@code >}
*/
@XmlElementDecl(namespace = "", name = "cqldefinition", scope = ClauseType.class)
public JAXBElement<CqldefinitionType> createClauseTypeCqldefinition(CqldefinitionType value) {
return new JAXBElement<>(
_ClauseTypeCqldefinition_QNAME, CqldefinitionType.class, ClauseType.class, value);
}

/**
* Create an instance of {@link JAXBElement }{@code <}{@link CqlaggfunctionType }{@code >}
*
* @param value Java instance representing xml element's value.
* @return the new instance of {@link JAXBElement }{@code <}{@link CqlaggfunctionType }{@code >}
*/
@XmlElementDecl(namespace = "", name = "cqlaggfunction", scope = ClauseType.class)
public JAXBElement<CqlaggfunctionType> createClauseTypeCqlaggfunction(CqlaggfunctionType value) {
return new JAXBElement<>(
_ClauseTypeCqlaggfunction_QNAME, CqlaggfunctionType.class, ClauseType.class, value);
}
}
174 changes: 174 additions & 0 deletions src/main/java/gov/cms/madie/hqmf/ConstantMessages.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
package gov.cms.madie.hqmf;

/** The Class ConstantMessages. */
public interface ConstantMessages {

String CONTINUOUS_VARIABLE_SCORING = "Continuous Variable";

String PROPORTION_SCORING = "Proportion";

String RATIO_SCORING = "Ratio";

String COHORT_SCORING = "Cohort";

String POPULATION_CONTEXT_ID = "initialPopulation";

String NUMERATOR_CONTEXT_ID = "numerator";

String NUMERATOR_EXCLUSIONS_CONTEXT_ID = "numeratorExclusions";

String DENOMINATOR_CONTEXT_ID = "denominator";

String DENOMINATOR_EXCLUSIONS_CONTEXT_ID = "denominatorExclusions";

String DENOMINATOR_EXCEPTIONS_CONTEXT_ID = "denominatorExceptions";

String MEASURE_POPULATION_CONTEXT_ID = "measurePopulation";

String MEASURE_OBSERVATION_CONTEXT_ID = "measureObservation";

String USER_DEFINED_CONTEXT_DESC = "User-defined";

String POP_TAB = "Pop";

String POP_TAB_EXPANDED = "Population";

String NUM_TAB = "Num";

String NUM_TAB_EXPANDED = "Numerator";

String NUM_EX_TAB = "N Excl";

String NUM_EX_TAB_EXPANDED = "Numerator Exclusions";

String DEN_TAB = "Den";

String DEN_TAB_EXPANDED = "Denominator";

String EXCL_TAB = "D Excl";

String EXCL_TAB_EXPANDED = "Denominator Exclusions";

String EXCEP_TAB = "D Excep";

String EXCEP_TAB_EXPANDED = "Denominator Exceptions";

String MEASURE_POP_TAB = "Meas Pop";

String MEASURE_POP_TAB_EXPANDED = "Measure Population";

String MEASURE_OBS_TAB = "Meas Obs";

String MEASURE_OBS_TAB_EXPANDED = "Measure Observation";

String STRAT_TAB = "Strat";

String STRAT_TAB_EXPANDED = "Stratification";

String USER_DEFINED_TAB = "User-Defined";

String USER_DEFINED_TAB_EXPANDED = "User-Defined";

String MEASURE_PHRASE_TAB = "Measure Phrase";

String MEASURE_PHRASE_TAB_EXPANDED = "Measure Phrase";

String ATTRIBUTE = "Attribute";

String TIMING_ELEMENT = "Timing Element";

String PATIENT_CHARACTERISTIC_RACE = "Patient Characteristic Race";

String PATIENT_CHARACTERISTIC_ETHNICITY = "Patient Characteristic Ethnicity";

String PATIENT_CHARACTERISTIC_PAYER = "Patient Characteristic Payer";

String PATIENT_CHARACTERISTIC_GENDER = "Patient Characteristic Sex";

String GROUPING_CODE_SYSTEM = "Grouping";

String HL7_ADMINGENDER_CODE_SYSTEM = "Administrative Sex";

String CDC_CODE_SYSTEM = "CDC";

String SOURCE_OF_PAYMENT = "Source of Payment Typology";

String MAT_MODULE = "MAT";

String LOGIN_MODULE = "LOGIN";

String HARP_SUPPORT_MODULE = "HARP SUPPORT";

String PASSWORD = "password";

String PASSWORD_EXPIRE_DATE = "passwordExpireDate";

String LOGINID = "loginId";

String HARPID = "harpId";

String USER_EMAIL = "userEmail";

String URL = "url";

String INSERT = "Insert";

String UPDATE = "Update";

String DELETE = "Delete";

String USER_NOT_FOUND = "User Not Found";

String EMAIL_NOT_FOUND = "Email Not Found";

String TOOLTIP_FOR_OCCURRENCE =
"Select Specific Occurrence if you need to reference a specific occurrence of your element.";

String DEFAULT_SELECT = "--Select--";

String CREATE_NEW_MEASURE = "New Measure";

String CREATE_NEW_CQL = "New Library";

String MAXIMUM_ALLOWED_VERSION = "999.999";

String MAXIMUM_ALLOWED_MAJOR_VERSION = "999";

String MAXIMUM_ALLOWED_MINOR_VERSION = "999";

String GENDER_OID = "2.16.840.1.113762.1.4.1";

String RACE_OID = "2.16.840.1.114222.4.11.836";

String ETHNICITY_OID = "2.16.840.1.114222.4.11.837";

String PAYER_OID = "2.16.840.1.114222.4.11.3591";

String MAIN_TAB_LAYOUT_ID = "mainTab";

String MEASURE_COMPOSER_TAB = "measureTab";

String CQL_COMPOSER_TAB = "cqlTab";

String USER_DEFINED_QDM_OID = "1.1.1.1";

String USER_DEFINED_QDM_NAME = "User Defined QDM";

String PATIENT_CHARACTERISTIC_BIRTHDATE = "Patient Characteristic Birthdate";

String PATIENT_CHARACTERISTIC_EXPIRED = "Patient Characteristic Expired";

String DEAD = "Dead";

String BIRTHDATE = "Birthdate";

String DEAD_OID = "419099009";

String BIRTHDATE_OID = "21112-8";

String BIRTHDATE_CODE_SYSTEM_OID = "2.16.840.1.113883.6.1";

String DEAD_CODE_SYSTEM_OID = "2.16.840.1.113883.6.96";

String SUPPORT_EMAIL = "supportEmailAddress";
}
Loading
Loading