diff --git a/package-lock.json b/package-lock.json index bc014b1a0..f47ac6c50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "blueimp-md5": "^2.19.0", "classnames": "^2.3.1", "cqm-execution": "4.2.3", - "cqm-models": "^4.1.3", + "cqm-models": "^4.1.5", "dayjs": "^1.11.7", "fhir": "^4.11.1", "file-saver": "^2.0.5", @@ -7945,10 +7945,21 @@ "yarn.lock": "^0.0.1-security" } }, - "node_modules/cqm-models": { + "node_modules/cqm-execution/node_modules/cqm-models": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/cqm-models/-/cqm-models-4.1.3.tgz", "integrity": "sha512-OMAkvU09r2z4N8UklYdw84HYEWa1nIg+cjGn+tyA6D/BFFbSb/f51sCP62yFH0oLPFfqUN3bmuuZ4bymTwTkZg==", + "license": "Apache-2.0", + "dependencies": { + "cql-execution": "2.4.1", + "mongoose": "^5.13.20" + } + }, + "node_modules/cqm-models": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/cqm-models/-/cqm-models-4.1.5.tgz", + "integrity": "sha512-QwfjPLitVRtSKv1taNgGi2n+KSDhjrFTWZguyxYXv4z6DmlukotpYhKM0wR93pRWVX5h7D3xlGgaZozbMPCAQA==", + "license": "Apache-2.0", "dependencies": { "cql-execution": "2.4.1", "mongoose": "^5.13.20" @@ -8028,25 +8039,30 @@ } }, "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.1.tgz", + "integrity": "sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ==", "dev": true, + "license": "MIT", "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" + "browserify-cipher": "^1.0.1", + "browserify-sign": "^4.2.3", + "create-ecdh": "^4.0.4", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "diffie-hellman": "^5.0.3", + "hash-base": "~3.0.4", + "inherits": "^2.0.4", + "pbkdf2": "^3.1.2", + "public-encrypt": "^4.0.3", + "randombytes": "^2.1.0", + "randomfill": "^1.0.4" }, "engines": { - "node": "*" + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/css-blank-pseudo": { @@ -11389,10 +11405,11 @@ } }, "node_modules/http-proxy-middleware": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", - "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", + "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", "dev": true, + "license": "MIT", "dependencies": { "@types/http-proxy": "^1.17.8", "http-proxy": "^1.18.1", diff --git a/package.json b/package.json index 12ee1e140..3563fa082 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "blueimp-md5": "^2.19.0", "classnames": "^2.3.1", "cqm-execution": "4.2.3", - "cqm-models": "^4.1.3", + "cqm-models": "^4.1.5", "dayjs": "^1.11.7", "fhir": "^4.11.1", "file-saver": "^2.0.5", diff --git a/src/components/editTestCase/qdm/LeftPanel/ElementsTab/Elements/DataElementsCard/attributes/DisplayAttributeInputs.tsx b/src/components/editTestCase/qdm/LeftPanel/ElementsTab/Elements/DataElementsCard/attributes/DisplayAttributeInputs.tsx index a1fbb58c4..3f49ad6cd 100644 --- a/src/components/editTestCase/qdm/LeftPanel/ElementsTab/Elements/DataElementsCard/attributes/DisplayAttributeInputs.tsx +++ b/src/components/editTestCase/qdm/LeftPanel/ElementsTab/Elements/DataElementsCard/attributes/DisplayAttributeInputs.tsx @@ -1,11 +1,10 @@ import React, { useState } from "react"; -import { CQL, DataElement } from "cqm-models"; +import { QDMDate, CQL, DataElement } from "cqm-models"; import { DateField, TimeField, Button, } from "@madie/madie-design-system/dist/react"; -import dayjs from "dayjs"; import IntegerInput from "../../../../../../../common/IntegerInput/IntegerInput"; import "./DisplayAttributeInputs.scss"; import RatioInput from "../../../../../../../common/ratioInput/RatioInput"; @@ -57,27 +56,26 @@ const DisplayAttributeInputs = ({ }; const { cqmMeasureState } = useQdmExecutionContext(); const [cqmMeasure] = cqmMeasureState; - const displayAttributeInput = () => { switch (attributeType) { case "Date": return ( { - const newDate = dayjs.utc(e); - const newCQLDate: CQL.Date = new CQL.Date( - newDate.year(), - newDate.month() + 1, - newDate.date() - ); + handleDateChange={(date) => { + const newCQLDate = new QDMDate().cast({ + year: date.year(), + month: date.month() + 1, + day: date.date(), + }); setAttributeValue(newCQLDate); if (onChangeForComponentType) { onChangeForComponentType(newCQLDate); } }} + onBlur={() => {}} /> ); case "DateTime": diff --git a/src/components/editTestCase/qdm/LeftPanel/ElementsTab/Elements/DataElementsCard/timing/Timing.tsx b/src/components/editTestCase/qdm/LeftPanel/ElementsTab/Elements/DataElementsCard/timing/Timing.tsx index 6e82c89d2..21f29c456 100644 --- a/src/components/editTestCase/qdm/LeftPanel/ElementsTab/Elements/DataElementsCard/timing/Timing.tsx +++ b/src/components/editTestCase/qdm/LeftPanel/ElementsTab/Elements/DataElementsCard/timing/Timing.tsx @@ -1,7 +1,7 @@ import React from "react"; import DateTimeInput from "../../../../../../../common/dateTimeInput/DateTimeInput"; import DateTimeInterval from "../../../../../../../common/dateTimeInterval/DateTimeInterval"; -import { CQL } from "cqm-models"; +import { QDMDate } from "cqm-models"; import "./Timing.scss"; import { PRIMARY_TIMING_ATTRIBUTES } from "../../../../../../../../util/QdmAttributeHelpers"; import * as _ from "lodash"; @@ -24,11 +24,10 @@ const Timing = ({ canEdit, onChange, selectedDataElement }) => { const dateFormatToDisplay = (date) => { if (date) { const currentDate = dayjs(); - const dayjsDate = dayjs(currentDate) + return dayjs(currentDate) .set("year", date?.year) - .set("month", date?.month) + .set("month", date?.month - 1) .set("date", date?.day); - return dayjsDate; } return; }; @@ -82,11 +81,11 @@ const Timing = ({ canEdit, onChange, selectedDataElement }) => { ) || null } onChange={(newValue: any) => { - const newDate = new CQL.Date( - newValue.$y, - newValue.$M + 1, - newValue.$D - ); + const newDate = new QDMDate().cast({ + year: newValue.$y, + month: newValue.$M + 1, + day: newValue.$D, + }); handleChange(newDate, timingAttr.path); }} />