From bdf21a5a57fa2c3fba0cdc21eb0886d1ed2e0d12 Mon Sep 17 00:00:00 2001 From: laurendukes Date: Thu, 25 Jul 2019 16:55:55 -0400 Subject: [PATCH] Autogenerated: Update Github Pages demo Change-Id: I066aee5d977af2108ad7b19b65d879ff70414767 GitOrigin-RevId: 964768e40ec17c5b90631315df9bd8498e126af3 --- docs/main.js | 2 +- docs/main.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/main.js b/docs/main.js index 8ab3a8aa..639987d4 100644 --- a/docs/main.js +++ b/docs/main.js @@ -10792,7 +10792,7 @@ var UI_CONSTANTS_TOKEN = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["Injecti */ var UI_CONSTANTS = { SYNTH_DATA: 'This is synthesized data used only for demo purposes.', - LOINC_VERIFIED_STRING: 'These BCH data mappings were verified 2019-04-30. v.1.0.2.0', + LOINC_VERIFIED_STRING: 'These BCH data mappings were verified 2019-04-30. v.1.0.3.0', // Tooltip for adding a card inline ADD_TIMELINE_HERE: 'Add timeline here', // Dialog for adding an event to the custom timeline diff --git a/docs/main.js.map b/docs/main.js.map index 7bd940eb..3468c8e7 100644 --- a/docs/main.js.map +++ b/docs/main.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./src/$_lazy_route_resource lazy namespace object","webpack:///./src/app/app-routing.module.ts","webpack:///./src/app/app.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/cardcontainer/cardcontainer.component.css","webpack:///./src/app/cardcontainer/cardcontainer.component.html","webpack:///./src/app/cardcontainer/cardcontainer.component.ts","webpack:///./src/app/cardtypes/card/card.component.css","webpack:///./src/app/cardtypes/card/card.component.html","webpack:///./src/app/cardtypes/card/card.component.ts","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component.css","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component.html","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component.ts","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline.component.css","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline.component.html","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline.component.ts","webpack:///./src/app/cardtypes/legendstyles.css","webpack:///./src/app/cardtypes/multigraphcard/multigraphcard.component.css","webpack:///./src/app/cardtypes/multigraphcard/multigraphcard.component.ts","webpack:///./src/app/cardtypes/multigraphcard/multigraphcard.html","webpack:///./src/app/cardtypes/textboxcard/textboxcard.component.html","webpack:///./src/app/cardtypes/textboxcard/textboxcard.component.ts","webpack:///./src/app/clinicalconcepts/bch-microbio-code.ts","webpack:///./src/app/clinicalconcepts/display-grouping.ts","webpack:///./src/app/clinicalconcepts/loinc-code.ts","webpack:///./src/app/clinicalconcepts/resource-code-group.ts","webpack:///./src/app/clinicalconcepts/resource-code-manager-exports.ts","webpack:///./src/app/clinicalconcepts/resource-code-manager.ts","webpack:///./src/app/clinicalconcepts/rx-norm-group.ts","webpack:///./src/app/clinicalconcepts/rx-norm.ts","webpack:///./src/app/confirm-save/confirm-save.component.css","webpack:///./src/app/confirm-save/confirm-save.component.html","webpack:///./src/app/confirm-save/confirm-save.component.ts","webpack:///./src/app/data-selector-element/data-selector-element.component.css","webpack:///./src/app/data-selector-element/data-selector-element.component.html","webpack:///./src/app/data-selector-element/data-selector-element.component.ts","webpack:///./src/app/data-selector-menu/data-selector-menu.component.css","webpack:///./src/app/data-selector-menu/data-selector-menu.component.html","webpack:///./src/app/data-selector-menu/data-selector-menu.component.ts","webpack:///./src/app/date_utils.ts","webpack:///./src/app/debugger.service.ts","webpack:///./src/app/debugger/debugger.component.html","webpack:///./src/app/debugger/debugger.component.ts","webpack:///./src/app/delete-dialog/delete-dialog.component.html","webpack:///./src/app/delete-dialog/delete-dialog.component.ts","webpack:///./src/app/fhir-data-classes/annotated-diagnotic-report.ts","webpack:///./src/app/fhir-data-classes/annotated-observation.ts","webpack:///./src/app/fhir-data-classes/diagnostic-report.ts","webpack:///./src/app/fhir-data-classes/dosage.ts","webpack:///./src/app/fhir-data-classes/encounter.ts","webpack:///./src/app/fhir-data-classes/medication-administration.ts","webpack:///./src/app/fhir-data-classes/medication-order.ts","webpack:///./src/app/fhir-data-classes/medication.ts","webpack:///./src/app/fhir-data-classes/observation-interpretation-valueset.ts","webpack:///./src/app/fhir-data-classes/observation-set.ts","webpack:///./src/app/fhir-data-classes/observation.ts","webpack:///./src/app/fhir-data-classes/specimen.ts","webpack:///./src/app/fhir-http.service.ts","webpack:///./src/app/fhir-launch/fhir-launch.component.css","webpack:///./src/app/fhir-launch/fhir-launch.component.html","webpack:///./src/app/fhir-launch/fhir-launch.component.ts","webpack:///./src/app/fhir-resource-set.ts","webpack:///./src/app/fhir.service.ts","webpack:///./src/app/graphdatatypes/customizabledata.ts","webpack:///./src/app/graphdatatypes/graphdata.ts","webpack:///./src/app/graphdatatypes/labeled-series.ts","webpack:///./src/app/graphdatatypes/linegraphdata.ts","webpack:///./src/app/graphdatatypes/microbiographdata.ts","webpack:///./src/app/graphdatatypes/stepgraphdata.ts","webpack:///./src/app/graphtypes/axis-group.ts","webpack:///./src/app/graphtypes/axis.ts","webpack:///./src/app/graphtypes/customizable-graph/customizable-graph-annotation.ts","webpack:///./src/app/graphtypes/customizable-graph/customizable-graph.component.ts","webpack:///./src/app/graphtypes/graph.css","webpack:///./src/app/graphtypes/graph/graph.component.html","webpack:///./src/app/graphtypes/graph/graph.component.ts","webpack:///./src/app/graphtypes/legend-info.ts","webpack:///./src/app/graphtypes/linegraph/linegraph.component.ts","webpack:///./src/app/graphtypes/microbio-graph/microbio-graph.component.ts","webpack:///./src/app/graphtypes/scatterplot/scatterplot.component.ts","webpack:///./src/app/graphtypes/stepgraph/stepgraph.component.ts","webpack:///./src/app/graphtypes/tooltips/medication-tooltips.ts","webpack:///./src/app/graphtypes/tooltips/microbio-tooltips.ts","webpack:///./src/app/graphtypes/tooltips/observation-tooltips.ts","webpack:///./src/app/graphtypes/tooltips/tooltip.ts","webpack:///./src/app/help-dialog/help-dialog.component.css","webpack:///./src/app/help-dialog/help-dialog.component.html","webpack:///./src/app/help-dialog/help-dialog.component.ts","webpack:///./src/app/ifu-dialog/ifu-dialog.component.css","webpack:///./src/app/ifu-dialog/ifu-dialog.component.html","webpack:///./src/app/ifu-dialog/ifu-dialog.component.ts","webpack:///./src/app/mock-fhir.service.ts","webpack:///./src/app/result-error.ts","webpack:///./src/app/setup-data.service.ts","webpack:///./src/app/setup/setup.component.css","webpack:///./src/app/setup/setup.component.html","webpack:///./src/app/setup/setup.component.ts","webpack:///./src/app/smart-on-fhir-client.ts","webpack:///./src/app/theme/verily_colors.ts","webpack:///./src/app/timeline-controller/timeline-controller.component.css","webpack:///./src/app/timeline-controller/timeline-controller.component.html","webpack:///./src/app/timeline-controller/timeline-controller.component.ts","webpack:///./src/app/timeline-toolbar/timeline-toolbar.component.html","webpack:///./src/app/timeline-toolbar/timeline-toolbar.component.ts","webpack:///./src/app/unit_utils.ts","webpack:///./src/constants.ts","webpack:///./src/environments/environment.ts","webpack:///./src/main.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6E;;;;;;;;;;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,4CAA4C,WAAW;AACvD;AACA;AACA,4E;;;;;;;;;;;;ACZA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2CAA2C;AAC3C,EAAE;AACF,qDAAqD;AACrD,iDAAiD;;;;;;;AAEV;AACc;AAE0B;AACP;AACjB;AAEvD;;kBAEkB;AAClB,IAAM,MAAM,GAAW;IACrB,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,6FAAsB,EAAC;IACjD,EAAC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CAAC,CAAC","file":"main.js","sourcesContent":["var map = {\n\t\"./af\": \"./node_modules/moment/locale/af.js\",\n\t\"./af.js\": \"./node_modules/moment/locale/af.js\",\n\t\"./ar\": \"./node_modules/moment/locale/ar.js\",\n\t\"./ar-dz\": \"./node_modules/moment/locale/ar-dz.js\",\n\t\"./ar-dz.js\": \"./node_modules/moment/locale/ar-dz.js\",\n\t\"./ar-kw\": \"./node_modules/moment/locale/ar-kw.js\",\n\t\"./ar-kw.js\": \"./node_modules/moment/locale/ar-kw.js\",\n\t\"./ar-ly\": \"./node_modules/moment/locale/ar-ly.js\",\n\t\"./ar-ly.js\": \"./node_modules/moment/locale/ar-ly.js\",\n\t\"./ar-ma\": \"./node_modules/moment/locale/ar-ma.js\",\n\t\"./ar-ma.js\": \"./node_modules/moment/locale/ar-ma.js\",\n\t\"./ar-sa\": \"./node_modules/moment/locale/ar-sa.js\",\n\t\"./ar-sa.js\": \"./node_modules/moment/locale/ar-sa.js\",\n\t\"./ar-tn\": \"./node_modules/moment/locale/ar-tn.js\",\n\t\"./ar-tn.js\": \"./node_modules/moment/locale/ar-tn.js\",\n\t\"./ar.js\": \"./node_modules/moment/locale/ar.js\",\n\t\"./az\": \"./node_modules/moment/locale/az.js\",\n\t\"./az.js\": \"./node_modules/moment/locale/az.js\",\n\t\"./be\": \"./node_modules/moment/locale/be.js\",\n\t\"./be.js\": \"./node_modules/moment/locale/be.js\",\n\t\"./bg\": \"./node_modules/moment/locale/bg.js\",\n\t\"./bg.js\": \"./node_modules/moment/locale/bg.js\",\n\t\"./bm\": \"./node_modules/moment/locale/bm.js\",\n\t\"./bm.js\": \"./node_modules/moment/locale/bm.js\",\n\t\"./bn\": \"./node_modules/moment/locale/bn.js\",\n\t\"./bn.js\": \"./node_modules/moment/locale/bn.js\",\n\t\"./bo\": \"./node_modules/moment/locale/bo.js\",\n\t\"./bo.js\": \"./node_modules/moment/locale/bo.js\",\n\t\"./br\": \"./node_modules/moment/locale/br.js\",\n\t\"./br.js\": \"./node_modules/moment/locale/br.js\",\n\t\"./bs\": \"./node_modules/moment/locale/bs.js\",\n\t\"./bs.js\": \"./node_modules/moment/locale/bs.js\",\n\t\"./ca\": \"./node_modules/moment/locale/ca.js\",\n\t\"./ca.js\": \"./node_modules/moment/locale/ca.js\",\n\t\"./cs\": \"./node_modules/moment/locale/cs.js\",\n\t\"./cs.js\": \"./node_modules/moment/locale/cs.js\",\n\t\"./cv\": \"./node_modules/moment/locale/cv.js\",\n\t\"./cv.js\": \"./node_modules/moment/locale/cv.js\",\n\t\"./cy\": \"./node_modules/moment/locale/cy.js\",\n\t\"./cy.js\": \"./node_modules/moment/locale/cy.js\",\n\t\"./da\": \"./node_modules/moment/locale/da.js\",\n\t\"./da.js\": \"./node_modules/moment/locale/da.js\",\n\t\"./de\": \"./node_modules/moment/locale/de.js\",\n\t\"./de-at\": \"./node_modules/moment/locale/de-at.js\",\n\t\"./de-at.js\": \"./node_modules/moment/locale/de-at.js\",\n\t\"./de-ch\": \"./node_modules/moment/locale/de-ch.js\",\n\t\"./de-ch.js\": \"./node_modules/moment/locale/de-ch.js\",\n\t\"./de.js\": \"./node_modules/moment/locale/de.js\",\n\t\"./dv\": \"./node_modules/moment/locale/dv.js\",\n\t\"./dv.js\": \"./node_modules/moment/locale/dv.js\",\n\t\"./el\": \"./node_modules/moment/locale/el.js\",\n\t\"./el.js\": \"./node_modules/moment/locale/el.js\",\n\t\"./en-au\": \"./node_modules/moment/locale/en-au.js\",\n\t\"./en-au.js\": \"./node_modules/moment/locale/en-au.js\",\n\t\"./en-ca\": \"./node_modules/moment/locale/en-ca.js\",\n\t\"./en-ca.js\": \"./node_modules/moment/locale/en-ca.js\",\n\t\"./en-gb\": \"./node_modules/moment/locale/en-gb.js\",\n\t\"./en-gb.js\": \"./node_modules/moment/locale/en-gb.js\",\n\t\"./en-ie\": \"./node_modules/moment/locale/en-ie.js\",\n\t\"./en-ie.js\": \"./node_modules/moment/locale/en-ie.js\",\n\t\"./en-il\": \"./node_modules/moment/locale/en-il.js\",\n\t\"./en-il.js\": \"./node_modules/moment/locale/en-il.js\",\n\t\"./en-nz\": \"./node_modules/moment/locale/en-nz.js\",\n\t\"./en-nz.js\": \"./node_modules/moment/locale/en-nz.js\",\n\t\"./eo\": \"./node_modules/moment/locale/eo.js\",\n\t\"./eo.js\": \"./node_modules/moment/locale/eo.js\",\n\t\"./es\": \"./node_modules/moment/locale/es.js\",\n\t\"./es-do\": \"./node_modules/moment/locale/es-do.js\",\n\t\"./es-do.js\": \"./node_modules/moment/locale/es-do.js\",\n\t\"./es-us\": \"./node_modules/moment/locale/es-us.js\",\n\t\"./es-us.js\": \"./node_modules/moment/locale/es-us.js\",\n\t\"./es.js\": \"./node_modules/moment/locale/es.js\",\n\t\"./et\": \"./node_modules/moment/locale/et.js\",\n\t\"./et.js\": \"./node_modules/moment/locale/et.js\",\n\t\"./eu\": \"./node_modules/moment/locale/eu.js\",\n\t\"./eu.js\": \"./node_modules/moment/locale/eu.js\",\n\t\"./fa\": \"./node_modules/moment/locale/fa.js\",\n\t\"./fa.js\": \"./node_modules/moment/locale/fa.js\",\n\t\"./fi\": \"./node_modules/moment/locale/fi.js\",\n\t\"./fi.js\": \"./node_modules/moment/locale/fi.js\",\n\t\"./fo\": \"./node_modules/moment/locale/fo.js\",\n\t\"./fo.js\": \"./node_modules/moment/locale/fo.js\",\n\t\"./fr\": \"./node_modules/moment/locale/fr.js\",\n\t\"./fr-ca\": \"./node_modules/moment/locale/fr-ca.js\",\n\t\"./fr-ca.js\": \"./node_modules/moment/locale/fr-ca.js\",\n\t\"./fr-ch\": \"./node_modules/moment/locale/fr-ch.js\",\n\t\"./fr-ch.js\": \"./node_modules/moment/locale/fr-ch.js\",\n\t\"./fr.js\": \"./node_modules/moment/locale/fr.js\",\n\t\"./fy\": \"./node_modules/moment/locale/fy.js\",\n\t\"./fy.js\": \"./node_modules/moment/locale/fy.js\",\n\t\"./gd\": \"./node_modules/moment/locale/gd.js\",\n\t\"./gd.js\": \"./node_modules/moment/locale/gd.js\",\n\t\"./gl\": \"./node_modules/moment/locale/gl.js\",\n\t\"./gl.js\": \"./node_modules/moment/locale/gl.js\",\n\t\"./gom-latn\": \"./node_modules/moment/locale/gom-latn.js\",\n\t\"./gom-latn.js\": \"./node_modules/moment/locale/gom-latn.js\",\n\t\"./gu\": \"./node_modules/moment/locale/gu.js\",\n\t\"./gu.js\": \"./node_modules/moment/locale/gu.js\",\n\t\"./he\": \"./node_modules/moment/locale/he.js\",\n\t\"./he.js\": \"./node_modules/moment/locale/he.js\",\n\t\"./hi\": \"./node_modules/moment/locale/hi.js\",\n\t\"./hi.js\": \"./node_modules/moment/locale/hi.js\",\n\t\"./hr\": \"./node_modules/moment/locale/hr.js\",\n\t\"./hr.js\": \"./node_modules/moment/locale/hr.js\",\n\t\"./hu\": \"./node_modules/moment/locale/hu.js\",\n\t\"./hu.js\": \"./node_modules/moment/locale/hu.js\",\n\t\"./hy-am\": \"./node_modules/moment/locale/hy-am.js\",\n\t\"./hy-am.js\": \"./node_modules/moment/locale/hy-am.js\",\n\t\"./id\": \"./node_modules/moment/locale/id.js\",\n\t\"./id.js\": \"./node_modules/moment/locale/id.js\",\n\t\"./is\": \"./node_modules/moment/locale/is.js\",\n\t\"./is.js\": \"./node_modules/moment/locale/is.js\",\n\t\"./it\": \"./node_modules/moment/locale/it.js\",\n\t\"./it.js\": \"./node_modules/moment/locale/it.js\",\n\t\"./ja\": \"./node_modules/moment/locale/ja.js\",\n\t\"./ja.js\": \"./node_modules/moment/locale/ja.js\",\n\t\"./jv\": \"./node_modules/moment/locale/jv.js\",\n\t\"./jv.js\": \"./node_modules/moment/locale/jv.js\",\n\t\"./ka\": \"./node_modules/moment/locale/ka.js\",\n\t\"./ka.js\": \"./node_modules/moment/locale/ka.js\",\n\t\"./kk\": \"./node_modules/moment/locale/kk.js\",\n\t\"./kk.js\": \"./node_modules/moment/locale/kk.js\",\n\t\"./km\": \"./node_modules/moment/locale/km.js\",\n\t\"./km.js\": \"./node_modules/moment/locale/km.js\",\n\t\"./kn\": \"./node_modules/moment/locale/kn.js\",\n\t\"./kn.js\": \"./node_modules/moment/locale/kn.js\",\n\t\"./ko\": \"./node_modules/moment/locale/ko.js\",\n\t\"./ko.js\": \"./node_modules/moment/locale/ko.js\",\n\t\"./ku\": \"./node_modules/moment/locale/ku.js\",\n\t\"./ku.js\": \"./node_modules/moment/locale/ku.js\",\n\t\"./ky\": \"./node_modules/moment/locale/ky.js\",\n\t\"./ky.js\": \"./node_modules/moment/locale/ky.js\",\n\t\"./lb\": \"./node_modules/moment/locale/lb.js\",\n\t\"./lb.js\": \"./node_modules/moment/locale/lb.js\",\n\t\"./lo\": \"./node_modules/moment/locale/lo.js\",\n\t\"./lo.js\": \"./node_modules/moment/locale/lo.js\",\n\t\"./lt\": \"./node_modules/moment/locale/lt.js\",\n\t\"./lt.js\": \"./node_modules/moment/locale/lt.js\",\n\t\"./lv\": \"./node_modules/moment/locale/lv.js\",\n\t\"./lv.js\": \"./node_modules/moment/locale/lv.js\",\n\t\"./me\": \"./node_modules/moment/locale/me.js\",\n\t\"./me.js\": \"./node_modules/moment/locale/me.js\",\n\t\"./mi\": \"./node_modules/moment/locale/mi.js\",\n\t\"./mi.js\": \"./node_modules/moment/locale/mi.js\",\n\t\"./mk\": \"./node_modules/moment/locale/mk.js\",\n\t\"./mk.js\": \"./node_modules/moment/locale/mk.js\",\n\t\"./ml\": \"./node_modules/moment/locale/ml.js\",\n\t\"./ml.js\": \"./node_modules/moment/locale/ml.js\",\n\t\"./mn\": \"./node_modules/moment/locale/mn.js\",\n\t\"./mn.js\": \"./node_modules/moment/locale/mn.js\",\n\t\"./mr\": \"./node_modules/moment/locale/mr.js\",\n\t\"./mr.js\": \"./node_modules/moment/locale/mr.js\",\n\t\"./ms\": \"./node_modules/moment/locale/ms.js\",\n\t\"./ms-my\": \"./node_modules/moment/locale/ms-my.js\",\n\t\"./ms-my.js\": \"./node_modules/moment/locale/ms-my.js\",\n\t\"./ms.js\": \"./node_modules/moment/locale/ms.js\",\n\t\"./mt\": \"./node_modules/moment/locale/mt.js\",\n\t\"./mt.js\": \"./node_modules/moment/locale/mt.js\",\n\t\"./my\": \"./node_modules/moment/locale/my.js\",\n\t\"./my.js\": \"./node_modules/moment/locale/my.js\",\n\t\"./nb\": \"./node_modules/moment/locale/nb.js\",\n\t\"./nb.js\": \"./node_modules/moment/locale/nb.js\",\n\t\"./ne\": \"./node_modules/moment/locale/ne.js\",\n\t\"./ne.js\": \"./node_modules/moment/locale/ne.js\",\n\t\"./nl\": \"./node_modules/moment/locale/nl.js\",\n\t\"./nl-be\": \"./node_modules/moment/locale/nl-be.js\",\n\t\"./nl-be.js\": \"./node_modules/moment/locale/nl-be.js\",\n\t\"./nl.js\": \"./node_modules/moment/locale/nl.js\",\n\t\"./nn\": \"./node_modules/moment/locale/nn.js\",\n\t\"./nn.js\": \"./node_modules/moment/locale/nn.js\",\n\t\"./pa-in\": \"./node_modules/moment/locale/pa-in.js\",\n\t\"./pa-in.js\": \"./node_modules/moment/locale/pa-in.js\",\n\t\"./pl\": \"./node_modules/moment/locale/pl.js\",\n\t\"./pl.js\": \"./node_modules/moment/locale/pl.js\",\n\t\"./pt\": \"./node_modules/moment/locale/pt.js\",\n\t\"./pt-br\": \"./node_modules/moment/locale/pt-br.js\",\n\t\"./pt-br.js\": \"./node_modules/moment/locale/pt-br.js\",\n\t\"./pt.js\": \"./node_modules/moment/locale/pt.js\",\n\t\"./ro\": \"./node_modules/moment/locale/ro.js\",\n\t\"./ro.js\": \"./node_modules/moment/locale/ro.js\",\n\t\"./ru\": \"./node_modules/moment/locale/ru.js\",\n\t\"./ru.js\": \"./node_modules/moment/locale/ru.js\",\n\t\"./sd\": \"./node_modules/moment/locale/sd.js\",\n\t\"./sd.js\": \"./node_modules/moment/locale/sd.js\",\n\t\"./se\": \"./node_modules/moment/locale/se.js\",\n\t\"./se.js\": \"./node_modules/moment/locale/se.js\",\n\t\"./si\": \"./node_modules/moment/locale/si.js\",\n\t\"./si.js\": \"./node_modules/moment/locale/si.js\",\n\t\"./sk\": \"./node_modules/moment/locale/sk.js\",\n\t\"./sk.js\": \"./node_modules/moment/locale/sk.js\",\n\t\"./sl\": \"./node_modules/moment/locale/sl.js\",\n\t\"./sl.js\": \"./node_modules/moment/locale/sl.js\",\n\t\"./sq\": \"./node_modules/moment/locale/sq.js\",\n\t\"./sq.js\": \"./node_modules/moment/locale/sq.js\",\n\t\"./sr\": \"./node_modules/moment/locale/sr.js\",\n\t\"./sr-cyrl\": \"./node_modules/moment/locale/sr-cyrl.js\",\n\t\"./sr-cyrl.js\": \"./node_modules/moment/locale/sr-cyrl.js\",\n\t\"./sr.js\": \"./node_modules/moment/locale/sr.js\",\n\t\"./ss\": \"./node_modules/moment/locale/ss.js\",\n\t\"./ss.js\": \"./node_modules/moment/locale/ss.js\",\n\t\"./sv\": \"./node_modules/moment/locale/sv.js\",\n\t\"./sv.js\": \"./node_modules/moment/locale/sv.js\",\n\t\"./sw\": \"./node_modules/moment/locale/sw.js\",\n\t\"./sw.js\": \"./node_modules/moment/locale/sw.js\",\n\t\"./ta\": \"./node_modules/moment/locale/ta.js\",\n\t\"./ta.js\": \"./node_modules/moment/locale/ta.js\",\n\t\"./te\": \"./node_modules/moment/locale/te.js\",\n\t\"./te.js\": \"./node_modules/moment/locale/te.js\",\n\t\"./tet\": \"./node_modules/moment/locale/tet.js\",\n\t\"./tet.js\": \"./node_modules/moment/locale/tet.js\",\n\t\"./tg\": \"./node_modules/moment/locale/tg.js\",\n\t\"./tg.js\": \"./node_modules/moment/locale/tg.js\",\n\t\"./th\": \"./node_modules/moment/locale/th.js\",\n\t\"./th.js\": \"./node_modules/moment/locale/th.js\",\n\t\"./tl-ph\": \"./node_modules/moment/locale/tl-ph.js\",\n\t\"./tl-ph.js\": \"./node_modules/moment/locale/tl-ph.js\",\n\t\"./tlh\": \"./node_modules/moment/locale/tlh.js\",\n\t\"./tlh.js\": \"./node_modules/moment/locale/tlh.js\",\n\t\"./tr\": \"./node_modules/moment/locale/tr.js\",\n\t\"./tr.js\": \"./node_modules/moment/locale/tr.js\",\n\t\"./tzl\": \"./node_modules/moment/locale/tzl.js\",\n\t\"./tzl.js\": \"./node_modules/moment/locale/tzl.js\",\n\t\"./tzm\": \"./node_modules/moment/locale/tzm.js\",\n\t\"./tzm-latn\": \"./node_modules/moment/locale/tzm-latn.js\",\n\t\"./tzm-latn.js\": \"./node_modules/moment/locale/tzm-latn.js\",\n\t\"./tzm.js\": \"./node_modules/moment/locale/tzm.js\",\n\t\"./ug-cn\": \"./node_modules/moment/locale/ug-cn.js\",\n\t\"./ug-cn.js\": \"./node_modules/moment/locale/ug-cn.js\",\n\t\"./uk\": \"./node_modules/moment/locale/uk.js\",\n\t\"./uk.js\": \"./node_modules/moment/locale/uk.js\",\n\t\"./ur\": \"./node_modules/moment/locale/ur.js\",\n\t\"./ur.js\": \"./node_modules/moment/locale/ur.js\",\n\t\"./uz\": \"./node_modules/moment/locale/uz.js\",\n\t\"./uz-latn\": \"./node_modules/moment/locale/uz-latn.js\",\n\t\"./uz-latn.js\": \"./node_modules/moment/locale/uz-latn.js\",\n\t\"./uz.js\": \"./node_modules/moment/locale/uz.js\",\n\t\"./vi\": \"./node_modules/moment/locale/vi.js\",\n\t\"./vi.js\": \"./node_modules/moment/locale/vi.js\",\n\t\"./x-pseudo\": \"./node_modules/moment/locale/x-pseudo.js\",\n\t\"./x-pseudo.js\": \"./node_modules/moment/locale/x-pseudo.js\",\n\t\"./yo\": \"./node_modules/moment/locale/yo.js\",\n\t\"./yo.js\": \"./node_modules/moment/locale/yo.js\",\n\t\"./zh-cn\": \"./node_modules/moment/locale/zh-cn.js\",\n\t\"./zh-cn.js\": \"./node_modules/moment/locale/zh-cn.js\",\n\t\"./zh-hk\": \"./node_modules/moment/locale/zh-hk.js\",\n\t\"./zh-hk.js\": \"./node_modules/moment/locale/zh-hk.js\",\n\t\"./zh-tw\": \"./node_modules/moment/locale/zh-tw.js\",\n\t\"./zh-tw.js\": \"./node_modules/moment/locale/zh-tw.js\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) { // check for number or string\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn id;\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./node_modules/moment/locale sync recursive ^\\\\.\\\\/.*$\";","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./src/$$_lazy_route_resource lazy recursive\";","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\n\nimport {CardcontainerComponent} from './cardcontainer/cardcontainer.component';\nimport {FhirLaunchComponent} from './fhir-launch/fhir-launch.component';\nimport {SetupComponent} from './setup/setup.component';\n\n/* On their end, it's locked down so that the only acceptable redirect\nURL is localhost:8000/. So, we have to do a different path for\nauthentication. */\nconst routes: Routes = [\n {path: 'main', component: CardcontainerComponent},\n {path: 'setup', component: SetupComponent},\n {path: '', component: FhirLaunchComponent}, {path: '**', redirectTo: ''}\n];\n\n\n@NgModule({exports: [RouterModule], imports: [RouterModule.forRoot(routes)]})\n\nexport class AppRoutingModule {\n}\n","module.exports = \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2FwcC5jb21wb25lbnQuY3NzIn0= */\"","module.exports = \"\\n\\nMedTimeLine\\n\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component} from '@angular/core';\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n title = 'app';\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport 'fhirclient';\n\nimport {HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\nimport {FlexLayoutModule} from '@angular/flex-layout';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\n// tslint:disable-next-line:max-line-length\nimport {MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatCheckboxModule, MatDatepickerModule, MatDialogModule, MatDividerModule, MatExpansionModule, MatListModule, MatMenuModule, MatNativeDateModule, MatProgressSpinnerModule, MatRadioModule, MatSnackBarModule, MatStepperModule, MatToolbarModule, MatTooltipModule} from '@angular/material';\nimport {MatCardModule} from '@angular/material/card';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatInputModule} from '@angular/material/input';\nimport {BrowserModule} from '@angular/platform-browser';\nimport {NoopAnimationsModule} from '@angular/platform-browser/animations';\nimport {NgbModule} from '@ng-bootstrap/ng-bootstrap';\nimport {ChartsModule} from 'ng2-charts';\nimport {DragulaModule} from 'ng2-dragula';\nimport {NgxDaterangepickerMd} from 'ngx-daterangepicker-material';\nimport {UI_CONSTANTS, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {environment} from '../environments/environment';\n\nimport {AppRoutingModule} from './app-routing.module';\nimport {AppComponent} from './app.component';\nimport {CardcontainerComponent} from './cardcontainer/cardcontainer.component';\nimport {CardComponent} from './cardtypes/card/card.component';\n// tslint:disable-next-line:max-line-length\nimport {CustomizableTimelineDialogComponent} from './cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component';\nimport {CustomizableTimelineComponent} from './cardtypes/customizable-timeline/customizable-timeline.component';\nimport {MultiGraphCardComponent} from './cardtypes/multigraphcard/multigraphcard.component';\nimport {TextboxcardComponent} from './cardtypes/textboxcard/textboxcard.component';\nimport {ResourceCodeManager} from './clinicalconcepts/resource-code-manager';\nimport {ConfirmSaveComponent} from './confirm-save/confirm-save.component';\nimport {DataSelectorElementComponent} from './data-selector-element/data-selector-element.component';\nimport {DataSelectorMenuComponent} from './data-selector-menu/data-selector-menu.component';\nimport {DebuggerComponent} from './debugger/debugger.component';\nimport {DeleteDialogComponent} from './delete-dialog/delete-dialog.component';\nimport {FhirHttpService} from './fhir-http.service';\nimport {FhirLaunchComponent} from './fhir-launch/fhir-launch.component';\nimport {FhirService} from './fhir.service';\nimport {CustomizableGraphComponent} from './graphtypes/customizable-graph/customizable-graph.component';\nimport {LineGraphComponent} from './graphtypes/linegraph/linegraph.component';\nimport {MicrobioGraphComponent} from './graphtypes/microbio-graph/microbio-graph.component';\nimport {ScatterplotComponent} from './graphtypes/scatterplot/scatterplot.component';\nimport {StepGraphComponent} from './graphtypes/stepgraph/stepgraph.component';\nimport {HelpDialogComponent} from './help-dialog/help-dialog.component';\nimport {IfuDialogComponent} from './ifu-dialog/ifu-dialog.component';\nimport {MockFhirService} from './mock-fhir.service';\nimport {SetupComponent} from './setup/setup.component';\nimport {SMART_ON_FHIR_CLIENT} from './smart-on-fhir-client';\nimport {TimelineControllerComponent} from './timeline-controller/timeline-controller.component';\nimport {TimelineToolbarComponent} from './timeline-toolbar/timeline-toolbar.component';\n\n@NgModule({\n declarations: [\n AppComponent,\n FhirLaunchComponent,\n CardcontainerComponent,\n TextboxcardComponent,\n LineGraphComponent,\n ScatterplotComponent,\n StepGraphComponent,\n MultiGraphCardComponent,\n TimelineControllerComponent,\n CustomizableTimelineComponent,\n CustomizableGraphComponent,\n CustomizableTimelineDialogComponent,\n MicrobioGraphComponent,\n TimelineToolbarComponent,\n DataSelectorElementComponent,\n DataSelectorMenuComponent,\n HelpDialogComponent,\n CardComponent,\n DeleteDialogComponent,\n DebuggerComponent,\n SetupComponent,\n ConfirmSaveComponent,\n IfuDialogComponent,\n ],\n imports: [\n BrowserModule,\n NgbModule,\n MatCardModule,\n HttpClientModule,\n MatListModule,\n MatDividerModule,\n MatIconModule,\n NoopAnimationsModule,\n FormsModule,\n ReactiveFormsModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatButtonModule,\n MatAutocompleteModule,\n MatMenuModule,\n MatTooltipModule,\n FlexLayoutModule.withConfig({useColumnBasisZero: false}),\n MatDialogModule,\n MatStepperModule,\n MatToolbarModule,\n MatSnackBarModule,\n MatDatepickerModule,\n NgxDaterangepickerMd.forRoot({}),\n MatButtonToggleModule,\n MatNativeDateModule,\n MatCheckboxModule,\n MatRadioModule,\n ChartsModule,\n DragulaModule.forRoot(),\n AppRoutingModule,\n MatExpansionModule\n ],\n providers: [\n // This sets up a provider for the smart on fhir client defined by\n // assets/fhir-client.min.js (defined as symbol `FHIR`) so that it can be\n // injected into the service that uses it to allow for easier testing.\n {provide: SMART_ON_FHIR_CLIENT, useValue: FHIR}, {\n provide: FhirService,\n useClass: environment.useMockServer ? MockFhirService : FhirHttpService\n },\n {provide: ResourceCodeManager, useClass: ResourceCodeManager},\n {provide: UI_CONSTANTS_TOKEN, useValue: UI_CONSTANTS}\n ],\n bootstrap: [AppComponent],\n entryComponents: [\n CustomizableTimelineDialogComponent, HelpDialogComponent,\n DeleteDialogComponent, ConfirmSaveComponent, IfuDialogComponent\n ]\n})\nexport class AppModule {\n}\n","module.exports = \".cardContainer {\\n background-color: #202020; /* GREY_900 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n padding: 15px;\\n width: 100%;\\n min-height: 100%;\\n height: 100%;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n /* Disable selecting/highlighting on the page. */\\n -webkit-touch-callout: none; /* iOS Safari */\\n -webkit-user-select: none; /* Safari */\\n -moz-user-select: none; /* Firefox */\\n -ms-user-select: none; /* Internet Explorer/Edge */\\n user-select: none; /* Chrome and Opera */\\n}\\n\\n.draggable {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n height: 100%;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n}\\n\\n.flexSpacer {\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n}\\n\\n::ng-deep .mat-toolbar, .mat-toolbar h1, .mat-toolbar h2, .mat-toolbar h3, .mat-toolbar h4, .mat-toolbar h5, .mat-toolbar h6, .mat-toolbar-row, .mat-toolbar-single-row {\\n display: -ms-flexbox; /* For IE10 */\\n}\\n\\n.mat-toolbar {\\n /* Deep Purple 800 to Pink 900 */\\n background-image: -webkit-gradient(linear, left top, right top, from(#4527A0) , to(#870D4E));\\n background-image: linear-gradient(to right, #4527A0 , #870D4E);\\n color: white;\\n}\\n\\n::ng-deep .gu-unselectable app-data-selector-menu {\\n /* Hide the data selector menus while a card is being dragged. */\\n opacity: 0 !important;\\n}\\n\\n.makeGutters {\\n padding-right: 50px;\\n padding-left: 50px;\\n}\\n\\n::ng-deep .mat-toolbar-single-row {\\n white-space: unset !important;\\n}\\n\\n::ng-deep .timelineToolbarMain {\\n float: right;\\n margin-right: 15px;\\n display: -ms-flexbox; /* For IE10 */\\n}\\n\\n::ng-deep app-card {\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n flex-direction: row;\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n}\\n\\n::ng-deep app-data-selector-menu {\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n flex-direction: row;\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZGNvbnRhaW5lci9jYXJkY29udGFpbmVyLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSx5QkFBeUIsRUFBRSxhQUFhO0VBQ3hDLG9CQUFhO0VBQWIsYUFBYTtFQUNiLG9CQUFvQixFQUFFLGFBQWE7RUFDbkMsYUFBYTtFQUNiLFdBQVc7RUFDWCxnQkFBZ0I7RUFDaEIsWUFBWTtFQUNaLDRCQUFzQjtFQUF0Qiw2QkFBc0I7VUFBdEIsc0JBQXNCLEVBQ00sYUFBYTtFQUN6QyxnREFBZ0Q7RUFDaEQsMkJBQTJCLEVBQUUsZUFBZTtFQUM1Qyx5QkFBeUIsRUFBRSxXQUFXO0tBQ25DLHNCQUFzQixFQUFFLFlBQVk7TUFDbkMscUJBQXFCLEVBQUUsMkJBQTJCO1VBQzlDLGlCQUFpQixFQUFFLHFCQUFxQjtBQUNsRDs7QUFFQTtFQUNFLG9CQUFhO0VBQWIsYUFBYTtFQUNiLG9CQUFvQjtFQUNwQixZQUFZO0VBQ1osNEJBQXNCO0VBQXRCLDZCQUFzQjtVQUF0QixzQkFBc0IsRUFDTSxhQUFhO0FBQzNDOztBQUVBO0VBQ0UsbUJBQVk7VUFBWixZQUFZO0VBQ1osZ0JBQWdCLEVBQUUsYUFBYTtBQUNqQzs7QUFFQTtFQUNFLG9CQUFvQixFQUFFLGFBQWE7QUFDckM7O0FBRUE7R0FDRyxnQ0FBZ0M7RUFDakMsNEZBQThEO0VBQTlELDhEQUE4RDtFQUM5RCxZQUFZO0FBQ2Q7O0FBRUE7RUF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WN0b3ItbWVudSB7XG4gIC8qIEhpZGUgdGhlIGRhdGEgc2VsZWN0b3IgbWVudXMgd2hpbGUgYSBjYXJkIGlzIGJlaW5nIGRyYWdnZWQuICovXG4gIG9wYWNpdHk6IDAgIWltcG9ydGFudDtcbn1cblxuLm1ha2VHdXR0ZXJzIHtcbiAgcGFkZGluZy1yaWdodDogNTBweDtcbiAgcGFkZGluZy1sZWZ0OiA1MHB4O1xufVxuXG46Om5nLWRlZXAgLm1hdC10b29sYmFyLXNpbmdsZS1yb3cge1xuICB3aGl0ZS1zcGFjZTogdW5zZXQgIWltcG9ydGFudDtcbn1cblxuOjpuZy1kZWVwIC50aW1lbGluZVRvb2xiYXJNYWluIHtcbiAgZmxvYXQ6IHJpZ2h0O1xuICBtYXJnaW4tcmlnaHQ6IDE1cHg7XG4gIGRpc3BsYXk6IC1tcy1mbGV4Ym94OyAgLyogRm9yIElFMTAgKi9cbn1cblxuOjpuZy1kZWVwIGFwcC1jYXJkIHtcbiAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgLW1zLWZsZXgtZGlyZWN0aW9uOiByb3c7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGRpc3BsYXk6IC1tcy1mbGV4Ym94OyAvKiBGb3IgSUUxMCAqL1xufVxuXG46Om5nLWRlZXAgYXBwLWRhdGEtc2VsZWN0b3ItbWVudSB7XG4gIGZsZXgtZGlyZWN0aW9uOiByb3c7XG4gIC1tcy1mbGV4LWRpcmVjdGlvbjogcm93O1xuICBkaXNwbGF5OiBmbGV4O1xuICBkaXNwbGF5OiAtbXMtZmxleGJveDsgLyogRm9yIElFMTAgKi9cbn1cbiJdfQ== */\"","module.exports = \"\\n \\n \\n \\n
\\n \\n \\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n \\n \\n \\n \\n \\n \\n
\\n
\\n \\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, Inject} from '@angular/core';\nimport {MatDialog, MatDialogRef, MatSnackBar} from '@angular/material';\nimport html2canvas from 'html2canvas';\nimport {DateTime, Interval} from 'luxon';\nimport {DragulaService} from 'ng2-dragula';\nimport {Subscription} from 'rxjs';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\nimport {v4 as uuid} from 'uuid';\n\nimport {environment} from '../../environments/environment';\nimport {ResourceCodeManager} from '../clinicalconcepts/resource-code-manager';\nimport {ConfirmSaveComponent} from '../confirm-save/confirm-save.component';\nimport {DeleteDialogComponent} from '../delete-dialog/delete-dialog.component';\nimport {FhirService} from '../fhir.service';\nimport {CustomizableData} from '../graphdatatypes/customizabledata';\nimport {AxisGroup} from '../graphtypes/axis-group';\nimport {ChartType} from '../graphtypes/graph/graph.component';\nimport {SetupDataService} from '../setup-data.service';\n\n@Component({\n selector: 'app-cardcontainer',\n templateUrl: './cardcontainer.component.html',\n styleUrls: ['./cardcontainer.component.css'],\n entryComponents: [DeleteDialogComponent],\n})\nexport class CardcontainerComponent {\n // How long to display the snack bar for.\n private readonly DISPLAY_TIME = 6000;\n\n // Whether or not to display the debugger.\n useDebugger = environment.useDebugger;\n\n /**\n * The format of each object in the array is an object representing a line\n * drawn on the chart, that has a value, text, and class field. The value\n * field represents the x-position of the line to be drawn, while the class\n * represents the class name, and the text represents the text displayed near\n * the line.\n */\n eventlines: Array<{[key: string]: number | string}> = [];\n\n // The concepts that are actually being displayed on the page.\n // We keep track of unique ids for each displayed card, to allow removal on\n // clicking the trashcan icon.\n\n readonly displayedConcepts:\n Array<{[key: string]: AxisGroup | string | CustomizableData}> = [];\n\n // The original concepts to duplicate, if necessary.\n readonly originalConcepts: AxisGroup[];\n\n // Hold an instance of this enum so that the HTML template can access it.\n readonly chartType = ChartType;\n\n /**\n * By default make the date range displayed the past seven days.\n */\n dateRange: Interval =\n Interval.fromDateTimes(DateTime.utc().minus({days: 7}), DateTime.utc());\n\n // Holds a subscription to the observable sequence of events emitted by the\n // Dragula Service.\n private readonly subs = new Subscription();\n\n // Holds the most recently removed card from the container, mapping the index\n // of the displayed card to the displayedConcept value.\n private recentlyRemoved:\n [number, {[key: string]: AxisGroup | string | CustomizableData}];\n\n // The reference for the Delete Card Dialog opened.\n private deleteDialogRef: MatDialogRef;\n\n // The reference for the Save Snapshot Dialog opened.\n private saveDialogRef: MatDialogRef;\n\n // A map of custom timeline id to the event lines corresponding to that\n // timeline.\n private eventsForCustomTimelines =\n new Map>();\n\n constructor(\n dragulaService: DragulaService,\n private fhirService: FhirService,\n resourceCodeManager: ResourceCodeManager,\n private snackBar: MatSnackBar,\n private deleteDialog: MatDialog,\n readonly setupDataService: SetupDataService,\n private saveDialog: MatDialog,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any,\n ) {\n const displayGroups = resourceCodeManager.getDisplayGroupMapping();\n /* Load in the concepts to display, flattening them all into a\n * single-depth array. */\n this.originalConcepts = Array.from(displayGroups.values())\n .reduce((acc, val) => acc.concat(val), []);\n this.setUpCards();\n this.setUpDrag(dragulaService);\n }\n\n private setUpCards() {\n // Add a textbox at the top of the card list.\n this.addTextbox();\n // Add a custom timeline to the top of the card list.\n this.addCustomTimeline();\n // Add all cards selected at the set-up screen.\n for (const concept of this.setupDataService.selectedConcepts) {\n this.displayedConcepts.push({'id': uuid(), 'concept': concept});\n }\n }\n\n // Ensures that the order of displayed concepts is updated as the user drags\n // cards around.\n private setUpDrag(dragulaService: DragulaService) {\n this.subs.add(dragulaService.drop('graphcards').subscribe((value) => {\n // Rearrange the order of this.displayedConcepts if graph/textbox\n // cards are reordered. We do not use dragulaModel since we cannot use\n // it for separate lists on the configuration panel.\n let originalIndex = this.displayedConcepts.map(x => x.id).indexOf(\n value.el.getAttribute('data-index'));\n const siblingIndex = this.getSiblingIdx(value);\n const elementDisplayed = this.displayedConcepts[originalIndex];\n // Add the element to its new position.\n this.displayedConcepts.splice(siblingIndex, 0, elementDisplayed);\n // Adjust the original position if needed.\n if (siblingIndex < originalIndex) {\n originalIndex++;\n }\n this.displayedConcepts.splice(originalIndex, 1);\n\n recordGoogleAnalyticsEvent(\n 'moveCard', 'moveCard',\n (typeof elementDisplayed === 'string') ?\n (elementDisplayed as string) :\n (elementDisplayed.label as string));\n }));\n }\n\n /**\n * Gets the index of the card below a dragged-and-dropped card's new place.\n */\n private getSiblingIdx(value): number {\n let siblingIndex;\n if (value.sibling === null) {\n // Dragged to bottom of list\n siblingIndex = this.displayedConcepts.length;\n } else {\n const siblingId = value.sibling.getAttribute('data-index');\n siblingIndex = this.displayedConcepts.map(x => x.id).indexOf(siblingId);\n }\n return siblingIndex;\n }\n\n /**\n * Adds a new annotation box to the card panel.\n * @param id: The id of the card above the position of the new annotation box.\n */\n addTextbox(id?: string) {\n const index =\n id ? (this.displayedConcepts.map(x => x.id).indexOf(id) + 1) : 0;\n this.displayedConcepts.splice(index, 0, {id: uuid(), concept: 'textbox'});\n }\n\n /**\n * Adds a new custom timeline to the card panel.\n * @param id: The id of the card above the position of the new annotation box.\n */\n addCustomTimeline(id?: string) {\n const index =\n id ? (this.displayedConcepts.map(x => x.id).indexOf(id) + 1) : 0;\n this.displayedConcepts.splice(\n index, 0, {id: uuid(), concept: 'customTimeline'});\n }\n\n // Listen for an event indicating that the date range has been changed on the\n // UI, and update the date range.\n changeDateRange($event) {\n this.dateRange = $event;\n }\n\n // Saves a snapshot of the graph drawer HTML to the EHR using a FhirService.\n snapshot() {\n html2canvas(document.body).then((canvas) => {\n this.saveDialogRef = this.saveDialog.open(\n ConfirmSaveComponent, {data: canvas, height: '80%'});\n\n this.saveDialogRef.afterClosed().subscribe(result => {\n // Only save the snapshot to the EHR if the user confirmed the save.\n if (result) {\n const date = DateTime.fromJSDate(new Date()).toISO();\n this.fhirService.saveStaticNote(canvas, date).then(res => {\n if (res) {\n this.snackBar.open(\n this.uiConstants.SAVED_TO_POWERCHART,\n this.uiConstants.DISMISS, {\n duration: this.DISPLAY_TIME, // Wait 6 seconds before\n // dismissing the snack bar.\n });\n } else {\n this.snackBar.open(\n this.uiConstants.ERROR_SAVED_TO_POWERCHART,\n this.uiConstants.DISMISS, {\n duration: this.DISPLAY_TIME, // Wait 6 seconds before\n // dismissing the snack bar.\n });\n }\n });\n\n\n recordGoogleAnalyticsEvent(\n 'saveStaticSnapshot', 'save', new Date().toDateString());\n }\n });\n });\n }\n\n // Listen for an event indicating that a \"delete\" button has been clicked on a\n // card currently displayed, and update the displayed concepts\n // accordingly after asking for confirmation of deletion.\n removeDisplayedCard($event) {\n const index = this.displayedConcepts.map(x => x.id).indexOf($event.id);\n const concept = this.displayedConcepts[index];\n concept.value = $event.value;\n this.deleteDialogRef = this.deleteDialog.open(DeleteDialogComponent);\n this.deleteDialogRef.afterClosed().subscribe(result => {\n // The user wishes to delete the card.\n if (result) {\n this.displayedConcepts.splice(index, 1);\n this.recentlyRemoved = [index, concept];\n this.openSnackBar();\n if (this.eventsForCustomTimelines.get($event.id)) {\n // We only remove the event lines for this CustomTimeline if the user\n // confirms the deletion of the card.\n this.updateEventLines({id: $event.id});\n }\n }\n });\n }\n\n // Open a snack bar allowing for the user to potentially reverse the removal\n // of cards from the page. Only one snack bar can be opened at a time.\n private openSnackBar() {\n const message = this.uiConstants.CARD_REMOVED;\n const snackBarRef = this.snackBar.open(message, this.uiConstants.UNDO, {\n duration:\n this.DISPLAY_TIME, // Wait 6 seconds before dismissing the snack bar.\n });\n // Undo the most recent deletion according to what is stored in\n // recentlyRemoved.\n snackBarRef.onAction().subscribe(() => {\n const index = this.recentlyRemoved[0];\n this.displayedConcepts.splice(index, 0, this.recentlyRemoved[1]);\n if (this.displayedConcepts[index].concept === 'customTimeline') {\n this.updateEventLines({\n id: this.displayedConcepts[0].id,\n data: this.displayedConcepts[0].value\n });\n }\n recordGoogleAnalyticsEvent(\n 'undoDelete', 'deleteCard',\n Array.from(this.recentlyRemoved.values()).toString());\n });\n }\n\n /**\n * Listens for an event indicating that the user has selected to add the\n * concept card from the top toolbar. The card is added at the top of the\n * page, or, if the id of the closest card is specified, below the closest\n * card.\n * @param label The label of the new concept to add.\n * @param id The id of the card below which to add the new concept.\n */\n\n addConceptCard(label: string, id?: string) {\n const graphCardValue =\n this.originalConcepts.find(obj => (obj.label === label));\n // Insert the card at the top of the page\n // Insert after the closest card rather than before the card.\n const index =\n id ? (this.displayedConcepts.map(x => x.id).indexOf(id) + 1) : 0;\n this.displayedConcepts.splice(\n index, 0, {id: uuid(), concept: graphCardValue});\n }\n\n /**\n * Listens for an event indicating that the user has edited the points on a\n * custom timeline, and updates the x-axis eventlines displayed on all other\n * charts.\n * @param $event The updated CustomizableData from which we calculate event\n * lines for each chart to display, along with the id of the updated.\n *\n */\n\n updateEventLines($event) {\n let times = [];\n if ($event.data) {\n times = Array.from($event.data.annotations.keys()).map(x => Number(x));\n }\n const eventlines = times.map(x => {\n return {\n value: x,\n text: $event.data.annotations.get(x).title,\n color: $event.data.annotations.get(x).color.hex()\n };\n });\n this.eventsForCustomTimelines.set($event.id, eventlines);\n\n // Consolidate all event lines from all custom timelines.\n let allEvents = [];\n for (const events of Array.from(this.eventsForCustomTimelines.values())) {\n allEvents = allEvents.concat(events);\n }\n this.eventlines = allEvents;\n }\n}\n","module.exports = \".mat-card {\\n cursor: -webkit-grab;\\n cursor: grab;\\n margin-top:0px;\\n margin-bottom:0px;\\n margin-left: 35px; /* Leave space for the \\\"add card\\\" button. */\\n padding-top: 0px;\\n padding-bottom: 0px;\\n padding-right: 20px;\\n padding-left: 0px;\\n -webkit-transition: box-shadow .1s;\\n transition: box-shadow .1s;\\n background-color: rgb(248, 248, 248);\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n flex-direction: row; /* For IE10 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n width: 100%;\\n max-width: 100%;\\n}\\n\\n::ng-deep .inEditMode .mat-card {\\n background-color: rgb(226, 226, 226) !important;\\n}\\n\\n.mat-card:hover {\\n background-color: rgb(240, 240, 240);\\n box-shadow: 0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);\\n}\\n\\n.colorbar {\\n margin-right: 6px;\\n min-width: 24px;\\n border-top-left-radius: 4px;\\n border-bottom-left-radius: 4px;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-flex: 0;\\n flex: 0 0 0%;\\n -ms-flex: 0 0 0%; /* For IE10 */\\n align-content: center;\\n -ms-flex-line-pack: center; /* Align content: center conversion for IE10 */\\n -webkit-box-pack: center;\\n justify-content: center;\\n -ms-flex-pack: center; /* Justify content: center conversion for IE10 */\\n align-self: stretch;\\n -ms-flex-item-align: stretch; /* Align self: stretch conversion for IE10 */\\n}\\n\\n.mat-icon {\\n color: rgb(34, 44, 66);\\n cursor: pointer;\\n opacity: .3;\\n -webkit-transition: opacity .3s;\\n transition: opacity .3s;\\n}\\n\\n.removeCardButton {\\n opacity: 0;\\n}\\n\\n.mat-card:hover .mat-icon {\\n opacity: .8;\\n}\\n\\n.mat-card:hover .dragCardIcon.mat-icon {\\n opacity: .4;\\n}\\n\\n.dragCardIcon {\\n opacity: 0;\\n margin-bottom: 15px;\\n}\\n\\n.labelColumn {\\n padding: 3px;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-flex: 0;\\n flex: 0 0 auto;\\n -ms-flex: 0 0 auto; /* For IE10 */\\n}\\n\\n.label {\\n width: 100%;\\n word-wrap: break-word;\\n -webkit-box-flex: 1;\\n flex: 1 1 auto;\\n -ms-flex: 1 1 auto; /* For IE10 */\\n font-family: 'Montserrat', sans-serif;\\n}\\n\\n::ng-deep .mat-input-element:disabled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AtbXMtZmxleGJveDsgLyogRm9yIElFMTAgKi9cbiAgZmxleDogMCAwIGF1dG87XG4gIC1tcy1mbGV4OiAwIDAgYXV0bzsgLyogRm9yIElFMTAgKi9cbn1cblxuLmxhYmVsIHtcbiAgd2lkdGg6IDEwMCU7XG4gIHdvcmQtd3JhcDogYnJlYWstd29yZDtcbiAgZmxleDogMSAxIGF1dG87XG4gIC1tcy1mbGV4OiAxIDEgYXV0bzsgLyogRm9yIElFMTAgKi9cbiAgZm9udC1mYW1pbHk6ICdNb250c2VycmF0Jywgc2Fucy1zZXJpZjtcbn1cblxuOjpuZy1kZWVwIC5tYXQtaW5wdXQtZWxlbWVudDpkaXNhYmxlZHtcbiAgY29sb3I6IHJnYigwLDAsMCwgLjcpICFpbXBvcnRhbnQ7XG59XG4iXX0= */\"","module.exports = \"\\n\\n
\\n clear\\n \\n \\n drag_handle\\n \\n \\n
\\n
\\n
\\n
{{label}}
\\n \\n \\n
\\n \\n \\n
\\n \\n edit\\n \\n save\\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, Inject, Input, Output} from '@angular/core';\nimport * as Color from 'color';\nimport * as Colors from 'src/app/theme/verily_colors';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\n/**\n * This is the base template for all the cards in this app. It will show a\n * colored bar on the left hand side with icons for actions, and then\n * optionally a label and legend, then the contents of the card.\n */\n@Component({\n selector: 'app-card',\n templateUrl: './card.component.html',\n styleUrls: ['./card.component.css']\n})\nexport class CardComponent {\n @Input() color: Color = Colors.BLUE_GREY_500;\n @Input() id: string;\n @Input() label: string;\n @Input() isEditable = false;\n @Input() isRemovable = true;\n\n @Output() renderEvent = new EventEmitter();\n @Output() removeEvent = new EventEmitter();\n @Output() editEvent = new EventEmitter();\n @Output() saveEvent = new EventEmitter();\n\n inEditMode = false;\n\n constructor(@Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n // The events below need to get propogated up to the card container.\n\n // Called when the user clicks the trashcan button on the card.\n remove() {\n this.removeEvent.emit(this.id);\n }\n\n // Called when the card resizes.\n resize($event) {\n this.renderEvent.emit($event);\n }\n\n // Called when the user clicks on the edit button.\n edit($event) {\n this.inEditMode = true;\n this.editEvent.emit($event);\n }\n\n // Called when the user hits the save button to exit out of edit mode.\n save($event) {\n this.inEditMode = false;\n this.saveEvent.emit($event);\n }\n}\n","module.exports = \"ngb-timepicker {\\n font-size: 1rem;\\n}\\n\\n::ng-deep fieldset {\\n min-width: 0;\\n padding: 0;\\n margin: 0;\\n border: 0;\\n}\\n\\n::ng-deep .ngb-tp {\\n display: -webkit-box;\\n display: flex;\\n -webkit-box-align: center;\\n align-items: center;\\n}\\n\\n::ng-deep .ngb-tp-hour, .ngb-tp-meridian, .ngb-tp-minute, .ngb-tp-second {\\n display: -webkit-box;\\n display: flex;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column;\\n -webkit-box-align: center;\\n align-items: center;\\n justify-content: space-around;\\n}\\n\\n::ng-deep .ngb-tp-input-container {\\n width: 4em;\\n}\\n\\n::ng-deep .ngb-tp-spacer {\\n width: 50px !important;\\n text-align: center;\\n}\\n\\n::ng-deep .btn-link {\\n font-weight: 400;\\n color: #5E35B1;\\n background-color: transparent;\\n border-width: 1px;\\n cursor: pointer;\\n border-radius: 4px;\\n}\\n\\n::ng-deep .form-control {\\n display: block;\\n width: 100%;\\n padding: .375rem .75rem;\\n font-size: 1rem;\\n line-height: 1.5;\\n color: #495057;\\n background-color: #fff;\\n background-clip: padding-box;\\n border: 1px solid #ced4da;\\n border-radius: .25rem;\\n}\\n\\n::ng-deep .ngb-tp-input {\\n text-align: center;\\n width: inherit;\\n}\\n\\n::ng-deep .sr-only {\\n position: absolute;\\n width: 1px;\\n height: 1px;\\n padding: 0;\\n overflow: hidden;\\n clip: rect(0,0,0,0);\\n white-space: nowrap;\\n -webkit-clip-path: inset(50%);\\n clip-path: inset(50%);\\n border: none;\\n}\\n\\n::ng-deep .mat-error {\\n font-size: 12px;\\n}\\n\\n.mockPlaceholder {\\n font-size: 12px;\\n color: grey;\\n margin-top: 18px;\\n}\\n\\n::ng-deep .dateInput {\\n width: 100px !important;\\n}\\n\\n::ng-deep ngb-datepicker {\\n z-index: 4;\\n background-color:white;\\n}\\n\\n::ng-deep .date {\\n display: inline-block;\\n vertical-align: middle;\\n}\\n\\n::ng-deep .time {\\n display: inline-block;\\n margin-left:30px;\\n vertical-align: middle;\\n}\\n\\n::ng-deep .date .mockPlaceholder {\\n margin-bottom: 20px;\\n}\\n\\n::ng-deep .date .dateInput {\\n margin-bottom: 20px;\\n}\\n\\n::ng-deep .mat-dialog-container {\\n max-height: 400px !important;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZHR5cGVzL2N1c3RvbWl6YWJsZS10aW1lbGluZS9jdXN0b21pemFibGUtdGltZWxpbmUtZGlhbG9nL2N1c3RvbWl6YWJsZS10aW1lbGluZS1kaWFsb2cuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGVBQWU7QUFDakI7O0FBRUE7RUFDRSxZQUFZO0VBQ1osVUFBVTtFQUNWLFNBQVM7RUFDVCxTQUFTO0FBQ1g7O0FBRUE7RUFFRSxvQkFBYTtFQUFiLGFBQWE7RUFFYix5QkFBbUI7VUFBbkIsbUJBQW1CO0FBQ3JCOztBQUNBO0VBRUUsb0JBQWE7RUFBYixhQUFhO0VBRWIsNEJBQXNCO0VBQXRCLDZCQUFzQjtVQUF0QixzQkFBc0I7RUFFdEIseUJBQW1CO1VBQW5CLG1CQUFtQjtFQUVuQiw2QkFBNkI7QUFDL0I7O0FBRUE7RUFDRSxVQUFVO0FBQ1o7O0FBRUE7RUFDRSxzQkFBc0I7RUFDdEIsa0JBQWtCO0FBQ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ICFpbXBvcnRhbnQ7XG59XG5cbjo6bmctZGVlcCBuZ2ItZGF0ZXBpY2tlciB7XG4gIHotaW5kZXg6IDQ7XG4gIGJhY2tncm91bmQtY29sb3I6d2hpdGU7XG59XG5cbjo6bmctZGVlcCAuZGF0ZSB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgdmVydGljYWwtYWxpZ246IG1pZGRsZTtcbn1cblxuOjpuZy1kZWVwIC50aW1lIHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBtYXJnaW4tbGVmdDozMHB4O1xuICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO1xufVxuXG46Om5nLWRlZXAgLmRhdGUgLm1vY2tQbGFjZWhvbGRlciB7XG4gIG1hcmdpbi1ib3R0b206IDIwcHg7XG59XG5cbjo6bmctZGVlcCAuZGF0ZSAuZGF0ZUlucHV0IHtcbiAgbWFyZ2luLWJvdHRvbTogMjBweDtcbn1cblxuOjpuZy1kZWVwIC5tYXQtZGlhbG9nLWNvbnRhaW5lciB7XG4gIG1heC1oZWlnaHQ6IDQwMHB4ICFpbXBvcnRhbnQ7XG59Il19 */\"","module.exports = \"
\\n
\\n
\\n
Date *
\\n \\n
Invalid date
\\n
\\n
\\n
Time *
\\n \\n \\n
Invalid time
\\n
\\n
\\n Caution: Date outside of current range\\n
\\n
\\n
\\n \\n \\n Please enter a title.\\n \\n \\n \\n \\n
\\n Flag color\\n \\n \\n \\n \\n \\n
\\n
\\n \\n \\n
\\n
\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, Inject} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {NgbDateAdapter, NgbDateNativeAdapter} from '@ng-bootstrap/ng-bootstrap';\nimport * as Color from 'color';\nimport {DateTime, Interval} from 'luxon';\n// tslint:disable-next-line:max-line-length\nimport {CustomizableGraphAnnotation} from 'src/app/graphtypes/customizable-graph/customizable-graph-annotation';\n// tslint:disable-next-line:max-line-length\nimport * as Colors from 'src/app/theme/verily_colors';\n\n/**\n * A Dialog with a textarea input, used to set the description of points on the\n * CustomizableTimeline.\n */\n@Component({\n selector: 'app-customizable-timeline-dialog',\n templateUrl: './customizable-timeline-dialog.component.html',\n styleUrls: ['./customizable-timeline-dialog.component.css'],\n providers: [{provide: NgbDateAdapter, useClass: NgbDateNativeAdapter}]\n})\nexport class CustomizableTimelineDialogComponent {\n // The text input for this dialog box.\n userTitle: string;\n\n // The list of suggested times to display with the autocomplete.\n listOfTimes = [];\n\n // The list of colors the user will be able to choose from.\n listOfColors = [\n Colors.DEEP_CORAL,\n Colors.DEEP_ORANGE,\n Colors.DEEP_TURQUOISE,\n Colors.DEEP_CYAN,\n Colors.DEEP_PURPLE_600,\n ];\n\n // The selected color in this dialog box.\n selectedColor: string;\n\n // The description input for this dialog box.\n userDescription: string;\n\n // The FormControl handling the time selection for this dialog box.\n timeFormControl: FormControl;\n\n // The date selected for this dialog box.\n date: Date;\n\n // The time selected for this dialog box.\n time: any;\n\n // The date range currently being viewed.\n dateRange: Interval;\n\n constructor(\n public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public data: any) {\n this.date = new Date(data.date);\n const minutes = this.date.getMinutes();\n const hours = this.date.getHours();\n this.time = {hour: hours, minute: minutes};\n this.timeFormControl =\n new FormControl(this.time, (control: FormControl) => {\n const value = control.value;\n if (!value) {\n return null;\n }\n });\n // Set the default selected color as yellow if unset, or find the BCH Color\n // matching the selected color passed in.\n this.selectedColor = data.color ?\n this.listOfColors.find(c => c.hex() === data.color.hex()) :\n Colors.DEEP_CORAL;\n // Set the title if it is passed in.\n if (data.title) {\n this.userTitle = data.title;\n }\n // Set the description if it is passed in.\n if (data.description) {\n this.userDescription = data.description;\n }\n\n if (data.dateRange) {\n this.dateRange = Interval.fromDateTimes(\n this.data.dateRange.start.toLocal().startOf('day'),\n this.data.dateRange.end.toLocal().endOf('day'));\n }\n }\n\n // Closes the dialog popup without saving the user input.\n onCancel(): void {\n this.dialogRef.close();\n }\n\n // Closes the dialog popup and saves user input.\n onSave(): void {\n this.dialogRef.close(new CustomizableGraphAnnotation(\n DateTime.fromJSDate(this.getSelectedDate()),\n this.userTitle.trim(),\n this.userDescription,\n Color.rgb(this.selectedColor),\n ));\n }\n\n // Constructs a new Date based on user input.\n private getSelectedDate(): Date {\n const dateTime = new Date(this.date);\n if (!this.time || !this.timeFormControl.value) {\n return undefined;\n }\n // For date parsing to work in IE, we must remove all extraneous non-ASCII\n // characters added, and manually change the time.\n dateTime.setHours(this.time.hour, this.time.minute);\n return dateTime;\n }\n\n // Finds incomplete fields that are required and disables saving.\n findIncompleteFields() {\n return !this.userTitle ||\n (this.userTitle && this.userTitle.trim().length === 0) ||\n this.date === null || this.isInvalidDate() ||\n this.timeFormControl.hasError('required') ||\n this.timeFormControl.invalid;\n }\n\n // Returns whether the date input has an invalid date.\n isInvalidDate(): boolean {\n return isNaN(DateTime.fromJSDate(this.date).toMillis());\n }\n\n // Returns whether the date selected by the user falls outside the current\n // date range.\n dateNotInRange(): boolean {\n const dateTime = DateTime.fromJSDate(this.getSelectedDate());\n if (!this.dateRange) {\n return false;\n }\n return !(this.dateRange.contains(dateTime));\n }\n}\n","module.exports = \"::ng-deep [class*=\\\"timeline\\\"] .c3-xgrid-focus {\\n visibility: visible !important;\\n}\\n\\n::ng-deep .timeline .c3 {\\n cursor: default !important;\\n}\\n\\n::ng-deep .inEditMode .timeline .c3 {\\n cursor: pointer !important;\\n}\\n\\n/* Only display icons on flags in the CustomizableGraph if in edit mode. */\\n\\n::ng-deep app-customizable-graph.inEditMode .showIcon {\\n visibility: visible !important;\\n}\\n\\n::ng-deep [class*=\\\"tooltip-custom\\\"] {\\n position: absolute;\\n display: block;\\n font-size: 11px;\\n border-style: solid;\\n padding: 3px;\\n border-width: 1px;\\n border-color: grey;\\n border-radius: 3px;\\n min-height: 25px;\\n width: 200px;\\n max-height: 100px;\\n background-color: white;\\n overflow: auto;\\n color: white;\\n}\\n\\n::ng-deep [class*=\\\"tooltip-whole\\\"] {\\n position: absolute;\\n display: block;\\n min-height: 25px;\\n width: 0px;\\n max-height: 100px;\\n border-left-style: solid;\\n border-width: 1px;\\n}\\n\\n::ng-deep [class*=\\\"tooltip-title-custom\\\"] {\\n margin: 0px;\\n font-size: small;\\n text-align: center;\\n max-width: 120px;\\n display: inline-block;\\n vertical-align: bottom;\\n min-width: 120px;\\n overflow: auto;\\n margin-top: 5px;\\n overflow-wrap: break-word;\\n}\\n\\n::ng-deep [class*=\\\"tooltip-details-custom\\\"] {\\n display: none;\\n overflow: auto;\\n text-align: center;\\n overflow-wrap: break-word;\\n max-width: 120px;\\n}\\n\\n::ng-deep [id*=\\\"expand\\\"] {\\n visibility: hidden;\\n vertical-align: middle;\\n}\\n\\n::ng-deep [id*=\\\"delete\\\"] {\\n visibility: hidden;\\n vertical-align: middle;\\n}\\n\\n::ng-deep [id*=\\\"edit\\\"] {\\n visibility: hidden;\\n margin-top: 8px;\\n}\\n\\n.contents-block {\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column;\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n -webkit-box-flex: 1;\\n flex: 1 1 100%;\\n -ms-flex: 1 1 100%; /* For IE10 */\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZHR5cGVzL2N1c3RvbWl6YWJsZS10aW1lbGluZS9jdXN0b21pemFibGUtdGltZWxpbmUuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLDhCQUE4QjtBQUNoQzs7QUFFQTtFQUNFLDBCQUEwQjtBQUM1Qjs7QUFFQTtFQUNFLDBCQUEwQjtBQUM1Qjs7QUFFQSwwRUFBMEU7O0FB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46Om5nLWRlZXAgW2lkKj1cImVkaXRcIl0ge1xuICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gIG1hcmdpbi10b3A6IDhweDtcbn1cblxuLmNvbnRlbnRzLWJsb2NrIHtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgLW1zLWZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGRpc3BsYXk6IC1tcy1mbGV4Ym94O1xuICBmbGV4OiAxIDEgMTAwJTtcbiAgLW1zLWZsZXg6IDEgMSAxMDAlOyAvKiBGb3IgSUUxMCAqL1xufVxuIl19 */\"","module.exports = \"\\n \\n
\\n {{this.uiConstants.CUSTOM_TIMELINE_INSTRUCTIONS}}\\n
\\n
\\n
\\n \\n \\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// tslint:disable-next-line:max-line-length\nimport {Component, EventEmitter, Inject, Input, OnChanges, Output, SimpleChanges, ViewChild} from '@angular/core';\nimport {Interval} from 'luxon';\nimport {FhirService} from 'src/app/fhir.service';\nimport {CustomizableData} from 'src/app/graphdatatypes/customizabledata';\nimport {GraphData} from 'src/app/graphdatatypes/graphdata';\nimport {GraphComponent} from 'src/app/graphtypes/graph/graph.component';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\n/**\n * The customizable timeline lets the user plot any events they'd like to keep\n * track of as little flags along a timeline.\n */\n@Component({\n selector: 'app-customizable-timeline',\n templateUrl: './customizable-timeline.component.html',\n styleUrls: ['./customizable-timeline.component.css']\n})\nexport class CustomizableTimelineComponent implements OnChanges {\n // The GraphComponent this card holds.\n @ViewChild(GraphComponent) containedGraph!: GraphComponent;\n\n // The unique ID for this displayed card.\n @Input() id: string;\n\n /**\n * The x-axis for this card.\n */\n @Input() dateRange: Interval;\n // Data stored before deletion of the card. This is separate from this.data\n // to avoid unnecessary re-rendering of the graph.\n @Input() deletedData: any;\n\n // An event indicating that the event lines displayed on all other charts need\n // to be updated.\n @Output()\n updateEventLines =\n new EventEmitter<{[key: string]: string | CustomizableData}>();\n\n /** Propogate remove events up to the card container. */\n @Output() removeEvent = new EventEmitter();\n\n // The data for the graph contained.\n data: CustomizableData;\n\n // Whether or not this CustomizableTimeline is being edited.\n inEditMode = false;\n\n constructor(\n private fhirService: FhirService,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n this.data = CustomizableData.defaultEmptySeries();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.deletedData && changes.deletedData.currentValue) {\n this.data = this.deletedData;\n this.containedGraph.data = this.data;\n }\n }\n\n // Listens for an event indicating that the points on the CustomizableGraph\n // have been changed, and emits an event with the modified eventlines\n // displayed on all other charts.\n pointsChanged($event) {\n this.updateEventLines.emit({data: this.data, id: this.id});\n }\n\n // Called when the user clicks the trashcan button on the card.\n remove() {\n this.removeEvent.emit({id: this.id, value: this.data});\n recordGoogleAnalyticsEvent(\n 'deleteCustomTimeline', 'deleteCard', new Date().toDateString());\n }\n}\n","module.exports = \".legend {\\n cursor: pointer;\\n}\\n\\n/* This is the color swatch for the legends.*/\\n\\n.legend span {\\n border-style: solid !important;\\n height: 7px;\\n margin: 3px;\\n vertical-align: center;\\n width: 7px;\\n}\\n\\n/* This is a specific style for MultiGraphCard. */\\n\\n.contents-block {\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n}\\n\\n.axis {\\n -webkit-box-flex: 0;\\n flex: 0 0 auto;\\n -ms-flex: 0 0 auto; /* For IE10 */\\n}\\n\\n.mat-body {\\n font-family: 'Work Sans', sans-serif;\\n font-size: 14px;\\n}\\n/*# sourceMappingURL=data:application/json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ayB7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIC1tcy1mbGV4LWRpcmVjdGlvbjogY29sdW1uOyAvKiBGb3IgSUUxMCAqL1xuICBkaXNwbGF5OiBmbGV4O1xuICBkaXNwbGF5OiAtbXMtZmxleGJveDsgLyogRm9yIElFMTAgKi9cbiAgZmxleDogMSAxIDAlO1xuICAtbXMtZmxleDogMSAxIDAlOyAvKiBGb3IgSUUxMCAqL1xufVxuXG4uYXhpcyB7XG4gIGZsZXg6IDAgMCBhdXRvO1xuICAtbXMtZmxleDogMCAwIGF1dG87IC8qIEZvciBJRTEwICovXG59XG5cbi5tYXQtYm9keSB7XG4gIGZvbnQtZmFtaWx5OiAnV29yayBTYW5zJywgc2Fucy1zZXJpZjtcbiAgZm9udC1zaXplOiAxNHB4O1xufSJdfQ== */\"","module.exports = \"\\n.card-error {\\n white-space: pre-wrap;\\n word-break: break-all;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZHR5cGVzL211bHRpZ3JhcGhjYXJkL211bHRpZ3JhcGhjYXJkLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBO0VBQ0UscUJBQXFCO0VBQ3JCLHFCQUFxQjtBQUN2QiIsImZpbGUiOiJzcmMvYXBwL2NhcmR0eXBlcy9tdWx0aWdyYXBoY2FyZC9tdWx0aWdyYXBoY2FyZC5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiXG4uY2FyZC1lcnJvciB7XG4gIHdoaXRlLXNwYWNlOiBwcmUtd3JhcDtcbiAgd29yZC1icmVhazogYnJlYWstYWxsO1xufVxuIl19 */\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// tslint:disable-next-line:max-line-length\nimport {Component, EventEmitter, Input, OnChanges, OnInit, Output, QueryList, SimpleChanges, ViewChildren} from '@angular/core';\nimport * as Color from 'color';\nimport {DateTime, Interval} from 'luxon';\nimport {GraphData} from 'src/app/graphdatatypes/graphdata';\nimport {LabeledSeries} from 'src/app/graphdatatypes/labeled-series';\nimport {AxisGroup} from 'src/app/graphtypes/axis-group';\nimport {LegendInfo} from 'src/app/graphtypes/legend-info';\nimport {recordGoogleAnalyticsEvent} from 'src/constants';\n\nimport {ChartType, GraphComponent} from '../../graphtypes/graph/graph.component';\nimport {LineGraphComponent} from '../../graphtypes/linegraph/linegraph.component';\nimport * as Colors from '../../theme/verily_colors';\n\n/**\n * This card holds a label, one or more graphs on one or more axes, and a\n * dragger handle.\n */\n@Component({\n selector: 'app-multigraphcard',\n styleUrls: ['../legendstyles.css', './multigraphcard.component.css'],\n templateUrl: './multigraphcard.html',\n})\nexport class MultiGraphCardComponent implements OnChanges, OnInit {\n /** The GraphComponents this card holds. */\n @ViewChildren(GraphComponent)\n containedGraphs!: QueryList>;\n\n @Input() id: string;\n\n /**\n * The date range to use for graphs in this card\n */\n @Input() dateRange: Interval;\n\n /**\n * The AxisGroup displayed on this card.\n */\n @Input() axisGroup: AxisGroup;\n\n /**\n * The format of each object in the array is an object representing a line\n * drawn on the chart, that has a value, text, and class field. The value\n * field represents the x-position of the line to be drawn, while the class\n * represents the class name, and the text represents the text displayed near\n * the line.\n */\n @Input() eventlines: Array<{[key: string]: number | string}>;\n\n /** The x-regions to draw for this graph. */\n xRegions: Array<[DateTime, DateTime]>;\n\n /** Propogate remove events up to the card container. */\n @Output() removeEvent = new EventEmitter();\n\n /**\n * The label for this graphcard.\n */\n label: string;\n\n /**\n * The units text for this card. Blank if the axes have more than one unit.\n */\n unitsLabel = '';\n\n /** Holds the color corresponding to this card. */\n color: Color = Colors.BLUE_GREY_500; // Default color for a card component.\n\n /** Hold an instance of this enum so the HTML template can reference it. */\n ChartType: typeof ChartType = ChartType;\n\n /**\n * Maps legend categories to the corresponding series so that when you hover\n * over a legend category, it can highlight all the corresponding series.\n */\n readonly legendToSeries = new Map();\n\n /**\n * Sets up the class variables that are dependent on the @Input parameter to\n * this component, resourceCodeGroups.\n * @throws An Error if ResourceCodeGroups is undefined or contains mixed\n * clinical concepts.\n */\n ngOnInit() {\n if (!this.axisGroup) {\n throw Error(\n 'All MultiGraphCardComponents are expected to have an AxisGroup ' +\n ' as the data source, but none provided for card id ' + this.id);\n }\n this.label = this.axisGroup.label;\n this.color = this.axisGroup.displayGroup.fill;\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const dateRange = changes.dateRange;\n if (dateRange && dateRange.previousValue !== dateRange.currentValue) {\n this.loadNewData();\n }\n }\n\n private addSeriesToLegendMap(series: LabeledSeries) {\n // We do not want to add the normalBound series to the legend\n if (series.legendInfo.label === LineGraphComponent.NORMAL_BOUND_SERIES_NAME) {\n return;\n }\n if (!this.legendToSeries.has(series.legendInfo)) {\n this.legendToSeries.set(series.legendInfo, []);\n }\n const added: LabeledSeries[] = this.legendToSeries.get(series.legendInfo);\n added.push(series);\n\n this.legendToSeries.set(series.legendInfo, added);\n }\n\n private loadNewData() {\n Promise\n .all(this.axisGroup.axes.map(\n axis => axis.updateDateRange(this.dateRange)))\n .then(axisData => {\n this.getLabelText().then(lblText => {\n this.unitsLabel = lblText;\n });\n\n // Gather a list of all the unique legends and series displayed.\n this.legendToSeries.clear();\n for (const data of axisData) {\n for (const series of data.series) {\n this.addSeriesToLegendMap(series);\n }\n }\n\n // Kick off the promise to get all the x-regions. It will update\n // the class variable and then everything bound to it will update,\n // too.\n this.getAllXRegions();\n });\n }\n\n /**\n * Gets the label text for this card. If the axes have all matching units,\n * it returns the units; otherwise it returns a blank string.\n */\n private getLabelText(): Promise {\n return Promise\n .all(this.axisGroup.axes.map(\n axis => axis.updateDateRange(this.dateRange)))\n .then(dataArray => dataArray.map(data => data.series))\n .then(seriesNestedArray => {\n const flattened: LabeledSeries[] = [].concat(...seriesNestedArray);\n return flattened.map(series => series.unit)\n .filter(v => v !== undefined);\n })\n .then(allUnits => {\n const units = new Set(allUnits);\n if (units.size === 1 && allUnits[0] !== undefined) {\n return ' (' + allUnits[0] + ')';\n } else {\n this.updateAxisLabels();\n return '';\n }\n });\n }\n\n /**\n * Gets all the X regions for the axes contained in this group.\n */\n private getAllXRegions() {\n return Promise.all(this.axisGroup.axes.map(axis => axis.getXRegions()))\n .then(nestedXRegions => {\n this.xRegions = [].concat(...nestedXRegions);\n });\n }\n\n /**\n * If the axes on this card have different units, make sure that each\n * axis displays its units on the y-axis, for clarity.\n */\n private updateAxisLabels() {\n for (const axis of this.axisGroup.axes) {\n axis.updateDateRange(this.dateRange).then(axisData => {\n if (axisData && axis.label && axisData.series &&\n axisData.series.length > 0 && axisData.series[0].unit) {\n const units = ' (' + axisData.series[0].unit + ')';\n // Only add units if not done so already.\n if (axis.label.indexOf(units) === -1) {\n axis.label += units;\n }\n }\n });\n }\n }\n\n /**\n * Returns true if any of the LabeledSeries passed in has a datapoint\n * in the time range.\n * This is just a convenience function because this can't be evaluated\n * directly in the Angular template.\n */\n hasData(labeledSeries: LabeledSeries[]) {\n return labeledSeries.map(s => s.hasPointInRange(this.dateRange))\n .some(s => s === true);\n }\n\n /**\n * Highlights the listed series in any graph they appear in for this card.\n */\n focusOnSeries(labeledSeries: LabeledSeries[]) {\n this.containedGraphs.forEach(graph => {\n graph.focusOnSeries(labeledSeries);\n });\n }\n\n /**\n * Removes highlight from any series on this card.\n */\n resetChart() {\n this.containedGraphs.forEach(graph => {\n graph.resetChart();\n });\n }\n\n // The events below need to get propogated up to the card container.\n\n /**\n * Called when the user clicks the trashcan button on the card.\n */\n remove() {\n // We do not add a 'value' field because there is no internal value that\n // needs to be restored when the user reverts a deletion.\n this.removeEvent.emit({id: this.id});\n recordGoogleAnalyticsEvent('deleteConcept', 'deleteCard', this.label);\n }\n}\n","module.exports = \"\\n 1\\\" class=\\\"legends-block\\\">\\n \\n
\\n \\n \\n
{{series.key.label}}
\\n
\\n
\\n
\\n
\\n
\\n \\n \\n \\n errorError loading data for: {{axis.label}}\\n Technical details:
{{axis.errorMessage}}\\n
\\n \\n 1 ? axis.label : ''\\\" [showTicks]=\\\"axis.showTicks\\\">\\n 1 ? axis.label : ''\\\" [showTicks]=\\\"axis.showTicks\\\">\\n 1 ? axis.label : ''\\\">\\n \\n 1 ? axis.label : ''\\\">\\n \\n \\n
\\n
\\n
\\n\"","module.exports = \"\\n \\n \\n \\n {{getHintText()}} \\n \\n \\n\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, ElementRef, EventEmitter, Inject, Input, Output, ViewChild} from '@angular/core';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\n/**\n * A Material Card that displays a label, a textbox, and a draggable handle\n * in a row.\n */\n@Component({\n selector: 'app-textboxcard',\n templateUrl: './textboxcard.component.html',\n})\nexport class TextboxcardComponent {\n @ViewChild('textArea') textAreaElement: ElementRef;\n @Input() id: string;\n\n /** Propogate remove events up to the card container. */\n @Output() removeEvent = new EventEmitter();\n\n // Holds the text typed in the input field of the textbox.\n @Input() noteString: string;\n\n inEditMode = false;\n\n\n constructor(@Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n updateValue() {\n this.textAreaElement.nativeElement.innerHTML = this.noteString;\n }\n\n // The events below need to get propogated up to the card container.\n\n // Called when the user clicks the trashcan button on the card.\n remove() {\n // We pass a 'value' field with the contents of the textbox so that, in case\n // of restoration of a deleted textbox, the previous value can be displayed.\n this.removeEvent.emit({id: this.id, value: this.noteString});\n\n recordGoogleAnalyticsEvent(\n 'deleteTextbox', 'deleteCard', new Date().toDateString());\n }\n\n edit() {\n this.inEditMode = true;\n }\n\n save() {\n this.inEditMode = false;\n }\n\n getHintText() {\n if (this.inEditMode) {\n return this.uiConstants.SAVE_TEXT_HINT;\n } else {\n return this.uiConstants.EDIT_TEXT_HINT;\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Interval} from 'luxon';\nimport {APP_TIMESPAN} from 'src/constants';\n\nimport {AnnotatedDiagnosticReport} from '../fhir-data-classes/annotated-diagnotic-report';\nimport {DiagnosticReport} from '../fhir-data-classes/diagnostic-report';\nimport {FhirService} from '../fhir.service';\n\nimport {CachedResourceCodeGroup, ResourceCode} from './resource-code-group';\n\n/**\n * Holds BCHMicrobioCode codes. BCH provides a custom mapping for their\n * microbiology data since retrieving it is not yet supported in the Cerner\n * FHIR API implementation.\n */\nexport class BCHMicrobioCode extends ResourceCode {\n static readonly CODING_STRING = 'http://cerner.com/bch_mapping/';\n\n dataAvailableInAppTimeScope(fhirService: FhirService): Promise {\n // This is not an elegant way of implementing this function but since it's\n // a non-standard API server we aren't going to put much effort into\n // developing it further at this point.\n return fhirService.diagnosticReportsPresentWithCodes(\n new BCHMicrobioCodeGroup(\n fhirService, this.label, [this], undefined, undefined),\n APP_TIMESPAN);\n }\n}\n\n/**\n * Represents one or more LOINC codes that should be displayed together. In the\n * case of multiple LOINC codes in a group, you should provide a label for that\n * group.\n */\nexport class BCHMicrobioCodeGroup extends\n CachedResourceCodeGroup {\n /**\n * Gets a list of DiagnosticReports corresponding to this code group. Each\n * item in the list has the same specimen type as the label of this group, and\n * each report's list of results has a code that is in this group's list of\n * codes.\n */\n getResourceFromFhir(dateRange: Interval):\n Promise {\n return this.fhirService.getDiagnosticReports(this, dateRange)\n .then(\n reports =>\n reports.map(report => new AnnotatedDiagnosticReport(report)));\n }\n\n formatRawResults(rawResults: AnnotatedDiagnosticReport[]):\n Promise {\n const diagnosticReports = rawResults.map(result => result.report);\n return Promise.resolve(diagnosticReports);\n }\n\n /**\n * Returns whether there is any data available for this ResourceCode within\n * the fixed timescope of this app.\n * @override\n */\n dataAvailableInAppTimeScope(): Promise {\n return this.fhirService.diagnosticReportsPresentWithCodes(\n this, APP_TIMESPAN);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport * as Color from 'color';\nimport * as Colors from '../theme/verily_colors';\n\nexport const ALL_DISPLAY_GROUPS_MAP = new Map();\n\n/**\n * Represents the category that a certain chart's data might fall into, for\n * example a MedicationConcept such as \"Antibiotic\" or a ClinicalConcept such as\n * \"Lab result\"\n */\nexport class DisplayGrouping {\n static colorIdx = 0;\n fill: Color;\n outline: Color;\n\n constructor(readonly label: string, color?: Color, outline?: Color) {\n let tempColor: Color = color;\n if (color === undefined) {\n tempColor = Colors.getDataColors()[DisplayGrouping.colorIdx];\n DisplayGrouping.colorIdx =\n (DisplayGrouping.colorIdx + 1) % Colors.getDataColors().length;\n }\n this.fill = tempColor;\n this.outline = outline ? outline : tempColor;\n ALL_DISPLAY_GROUPS_MAP.set(label, this);\n }\n}\n\nexport const labResult = new DisplayGrouping('Lab Results', Colors.LIME);\nexport const vitalSign = new DisplayGrouping('Vital Signs', Colors.ORANGE);\nexport const med =\n new DisplayGrouping('Vancomycin and Gentamicin', Colors.TURQUOISE);\nexport const microbio = new DisplayGrouping('Microbiology', Colors.CYAN);\n// We declare more DisplayGroupings related to Microbiology results that are\n// used to classify points on the Microbiology chart.\nexport const posPrelimMB = new DisplayGrouping(\n 'Check Result Preliminary', Color('#e4e2e2'), Colors.ABNORMAL);\nexport const negPrelimMB = new DisplayGrouping(\n 'Negative Preliminary', Color('#e4e2e2'), Colors.BLUE_A700);\nexport const posFinalMB =\n new DisplayGrouping('Check Result Final', Colors.ABNORMAL);\nexport const negFinalMB =\n new DisplayGrouping('Negative Final', Colors.BLUE_A700);\n// We declare DisplayGroupings that correspond to report statuses that we might\n// encounter rarely.\nexport const posOtherNB =\n new DisplayGrouping('Check Result, Other', Colors.DEEP_GOLD);\nexport const negOtherMB =\n new DisplayGrouping('Negative, Other', Colors.DEEP_GOLD);\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Interval} from 'luxon';\nimport {APP_TIMESPAN} from 'src/constants';\n\nimport {AnnotatedObservation} from '../fhir-data-classes/annotated-observation';\nimport {Observation} from '../fhir-data-classes/observation';\nimport {ObservationSet} from '../fhir-data-classes/observation-set';\nimport {FhirService} from '../fhir.service';\nimport {ChartType} from '../graphtypes/graph/graph.component';\n\nimport {DisplayGrouping} from './display-grouping';\nimport {ResourceCode} from './resource-code-group';\nimport {CachedResourceCodeGroup} from './resource-code-group';\n\n/**\n * Holds LOINC codes.\n */\nexport class LOINCCode extends ResourceCode {\n static readonly CODING_STRING = 'http://loinc.org';\n\n dataAvailableInAppTimeScope(fhirService: FhirService): Promise {\n return fhirService.observationsPresentWithCode(this, APP_TIMESPAN);\n }\n}\n\n/**\n * Represents one or more LOINC codes that should be displayed together. In the\n * case of multiple LOINC codes in a group, you should provide a label for that\n * group.\n */\nexport class LOINCCodeGroup extends\n CachedResourceCodeGroup {\n constructor(\n /** FHIR service for retrieving data */\n readonly fhirService: FhirService,\n /** The label for this resource code group. */\n readonly label: string,\n /** The resource codes to display on this Axis. */\n readonly resourceCodes: ResourceCode[],\n /** The display grouping for this resource code group. */\n readonly displayGrouping: DisplayGrouping,\n /** The chart type for this Axis. */\n readonly chartType: ChartType,\n /**\n * The (optional) function that will make an observation into an\n * AnnotatedObservation so that the graph can show the appropriate\n * tooltip.\n */\n readonly makeAnnotated?:\n (observation: Observation,\n dateRange: Interval) => Promise) {\n super(fhirService, label, resourceCodes, displayGrouping, chartType);\n }\n\n /**\n * Gets one ObservationSet for each LOINCCode in the rawResults, and returns\n * a list of those ObservationSets.\n * @param rawResults: List of AnnotatedObservations to group into\n * ObservationSets\n * @returns: list of ObservationSets. One ObservationSet for each LOINCCode\n * found in the rawResults.\n */\n formatRawResults(rawResults: AnnotatedObservation[]):\n Promise {\n const mapObs = new Map();\n let maxPrecision = 0;\n for (const annotatedObservation of rawResults) {\n const observation = annotatedObservation.observation;\n // From this point on, each observation should have a value,\n // result, or interpretation. All observations that just had\n // innerComponents have been flattened out.\n let obsList = mapObs.get(observation.label);\n if (!obsList) {\n obsList = new Array();\n }\n obsList.push(annotatedObservation);\n if (observation.precision > maxPrecision) {\n maxPrecision = observation.precision;\n }\n mapObs.set(observation.label, obsList);\n }\n this.precision = maxPrecision;\n const doubleAnnotationArray = Array.from(mapObs.values());\n\n return Promise.all(doubleAnnotationArray.map(\n singleAnnotationArray =>\n Promise.all(singleAnnotationArray)\n .then(\n resolvedAnnotations =>\n new ObservationSet(resolvedAnnotations))));\n }\n\n /**\n * Gets list of Observations from the FHIR server and makes them annotated\n * if makeAnnotated function is defined.\n * If an Observation contains \"inner components\", this returns separate\n * Observations for those.\n * @param dateRange: date range to get results from FHIR for\n * @returns: List of Annotated Observations\n */\n getResourceFromFhir(dateRange: Interval): Promise {\n return this.fhirService.getObservationsForCodeGroup(this, dateRange)\n .then(\n observationDoubleArray => {\n // Unnest the inner and outer observations into one flattened\n // array per concept group.\n return observationDoubleArray.map(\n obsSingleArray =>\n Array.from(obsSingleArray)\n .reduce((acc: Observation[], observation) => {\n // The outer component may not have a\n // value or result.\n if (observation.value || observation.result ||\n observation.interpretation) {\n acc.push(observation);\n }\n // Add separate ObservationLists for\n // each inner component.\n if (observation.innerComponents.length > 0) {\n for (const innerComponent of\n observation.innerComponents) {\n acc.push(innerComponent);\n }\n }\n return acc;\n }, []));\n },\n rejection => {\n // If there is any error with constructing an Observation for any\n // code in this code group, throw the error.\n throw rejection;\n })\n .then(flattened => {\n const resultList = new Array>();\n flattened.forEach(conceptList => {\n for (const observation of conceptList) {\n if (this.makeAnnotated) {\n resultList.push(this.makeAnnotated(observation, dateRange));\n } else {\n resultList.push(\n Promise.resolve(new AnnotatedObservation(observation)));\n }\n }\n });\n return Promise.all(resultList);\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\n\nimport {TimestampedObject} from '../fhir-resource-set';\nimport {FhirService} from '../fhir.service';\nimport {ChartType} from '../graphtypes/graph/graph.component';\n\nimport {DisplayGrouping} from './display-grouping';\n\n/**\n * A code specifying the medication or observation type as well as the specific\n * medication or observation.\n */\nexport abstract class ResourceCode {\n /**\n * The string that holds the FHIR address for the coding system. Every\n * extending class should override this constant, although there is no way\n * we can syntactically enforce this in Typescript.\n */\n static readonly CODING_STRING;\n\n private static readonly CODE_STRING_TO_CODE:\n {[code: string]: ResourceCode} = {};\n\n static fromCodeString(code: string): ResourceCode {\n return ResourceCode.CODE_STRING_TO_CODE[code];\n }\n\n constructor(\n readonly codeString: string, readonly displayGrouping: DisplayGrouping,\n readonly label: string, readonly showByDefault = false,\n /* Absolute axis bounds for the graph displaying this ResourceCode. */\n readonly displayBounds?: [number, number],\n /* Whether or not to force the axis bounds, even if a smaller range\n containing all the data can be calculated. */\n readonly forceDisplayBounds = false) {\n ResourceCode.CODE_STRING_TO_CODE[codeString] = this;\n }\n\n /**\n * Returns whether there is any data available for this ResourceCode within\n * the fixed timescope of this app.\n */\n abstract dataAvailableInAppTimeScope(fhirService: FhirService):\n Promise;\n}\n\n/**\n * A class that holds a group of resource codes that should be displayed on\n * the same Axis together.\n */\nexport class ResourceCodeGroup {\n /* Whether or not to show this ResourceCodeGroup by default. This is true\n * when any ResourceCode in the group should be shown as default.*/\n readonly showByDefault: boolean;\n\n // The number of decimal places to show for any value associated with this\n // resource group. The default is 0, to minimize errors caused by unnecessary\n // trailing zeros.\n precision = 0;\n\n /**\n * When we've decided whether this resource code group has data available\n * in the app, it doesn't change over the course of the app lifetime, so we\n * cache it.\n */\n resolvedDataAvailableInAppTimeScope: boolean = undefined;\n\n constructor(\n readonly fhirService: FhirService,\n /** The label for this resource code group. */\n readonly label: string,\n /** The resource codes to display on this Axis. */\n readonly resourceCodes: ResourceCode[],\n /** The display grouping for this resource code group. */\n readonly displayGrouping: DisplayGrouping,\n /** The chart type for this Axis. */\n readonly chartType: ChartType) {\n this.showByDefault = this.resourceCodes.some(code => code.showByDefault);\n }\n\n /**\n * Returns whether there is any data available for this ResourceCode within\n * the fixed timescope of this app.\n */\n dataAvailableInAppTimeScope(): Promise {\n if (this.resolvedDataAvailableInAppTimeScope !== undefined) {\n return Promise.resolve(this.resolvedDataAvailableInAppTimeScope);\n }\n return Promise\n .all(this.resourceCodes.map(\n rc => rc.dataAvailableInAppTimeScope(this.fhirService)))\n .then(bools => {\n this.resolvedDataAvailableInAppTimeScope =\n bools.reduce((result, next) => result = result || next);\n return this.resolvedDataAvailableInAppTimeScope;\n });\n }\n}\n\n/**\n * CachedResourceCodeGroups cache their retrieved data in a dictionary keyed\n * by time interval.\n * @param T The type of data to be cached.\n */\nexport abstract class CachedResourceCodeGroup<\n T, R extends TimestampedObject> extends ResourceCodeGroup {\n dataCache = new Map();\n\n /**\n * Looks in the cache to see if data for this time interval exists. If not,\n * calls the implementing class's getResourceFromFhir function and caches\n * its data, then returns the data for the given time interval.\n */\n getResourceSet(dateRange: Interval): Promise {\n const originalDataCacheCopy = new Map(this.dataCache);\n\n // today's results will never be in the cache since we always want to get\n // updated results for today.\n const today = DateTime.utc().toISODate();\n const todaysResults = new Array();\n\n // get the days during the dateRange Inteval that we do not have in the\n // cache already.\n const daysToFetchFromFhir = new Array();\n\n // splits dateRange into an array of intervals - each 1 day long.\n const daysInRange =\n Interval\n .fromDateTimes(\n dateRange.start.startOf('day'), dateRange.end.endOf('day'))\n .splitBy({days: 1});\n\n // for each day in the range, check if it is in the cache already.\n // If not, add the day to the daysToFetchFromFhir and add an empty array\n // to the cache. We add an empty array so that if we don't get any results\n // back for a particular day, we know there is no data and we don't need to\n // request that day again.\n for (const dayRange of daysInRange) {\n const cacheKey = dayRange.start.toISODate();\n if (!this.dataCache.has(cacheKey)) {\n daysToFetchFromFhir.push(dayRange);\n // We do not want to cache today's results since their may be\n // additional results next time this data is fetched\n // from FHIR\n if (cacheKey !== today) {\n this.dataCache.set(cacheKey, new Array());\n }\n }\n }\n\n // This will give a list of the minimal covering set of intervals that\n // are not cached.\n const dateRangesToFetchFromFhir = Interval.merge(daysToFetchFromFhir);\n let fetchPromises = [];\n\n try {\n fetchPromises = dateRangesToFetchFromFhir.map(\n dateRangeToFetch =>\n this.getResourceFromFhir(dateRangeToFetch)\n .then(\n response => {\n for (const result of response) {\n const resultDate = result.timestamp.toISODate();\n // we keep today's results separate so that we\n // don't cache them.\n if (resultDate === today) {\n todaysResults.push(result);\n } else {\n this.dataCache.get(resultDate).push(result);\n }\n }\n },\n rejection => {\n // reset back to cache if any call to FHIR results in\n // an error.\n this.dataCache = originalDataCacheCopy;\n throw rejection;\n }));\n } catch (err) {\n // reset back to original cache if there were any issues adding to the\n // cache (such as a result not having a timestamp) - we do not want to\n // cache partial data.\n this.dataCache = originalDataCacheCopy;\n throw err;\n }\n\n return Promise.all(fetchPromises)\n .then(\n responseList => {\n return this.getResourceFromCache(dateRange).then(\n rawResults => this.formatRawResults(\n [].concat(rawResults, todaysResults)));\n },\n rejection => {\n this.dataCache = originalDataCacheCopy;\n throw rejection;\n });\n }\n\n /**\n * Gets data from the cache for the given date range.\n * @param dateRange date range to get data for\n */\n private getResourceFromCache(dateRange: Interval): Promise {\n // split the dateRange by day intervals and get data from the Cache.\n const allRawResults = new Array();\n dateRange.splitBy({days: 1}).forEach(dayRange => {\n allRawResults.push(...this.dataCache.get(dayRange.start.toISODate()));\n });\n return Promise.resolve(allRawResults);\n }\n\n /**\n * Formats raw results from the cache to results expected by the rendering\n * code.\n *\n * Note: This should really be a private method and never called by anything\n * except for getResourceSet. Since it is abstract though, we cannot make it\n * private.\n *\n * @param rawResults raw results from the cache that should be formatted.\n */\n abstract formatRawResults(rawResults: R[]): Promise;\n\n /**\n * This function should make the FHIR calls to get promises for the\n * resources corresponding to this resource code group.\n */\n abstract getResourceFromFhir(dateRange: Interval): Promise;\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {vitalSign} from './display-grouping';\nimport {LOINCCode} from './loinc-code';\n\nexport const bloodPressureLoincs = [\n new LOINCCode('55284-4', vitalSign, 'Blood Pressure', true),\n new LOINCCode(\n '8478-0', vitalSign, 'Mean Arterial Pressure (Device)', true, [25, 200])\n ];\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Injectable} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {Interval} from 'luxon';\n\nimport {LOINCCodeGroup} from '../clinicalconcepts/loinc-code';\nimport {AnnotatedObservation} from '../fhir-data-classes/annotated-observation';\nimport {Observation} from '../fhir-data-classes/observation';\nimport {FhirService} from '../fhir.service';\nimport {Axis} from '../graphtypes/axis';\nimport {AxisGroup} from '../graphtypes/axis-group';\nimport {ChartType} from '../graphtypes/graph/graph.component';\n\nimport {BCHMicrobioCode, BCHMicrobioCodeGroup} from './bch-microbio-code';\nimport {DisplayGrouping, labResult, med, microbio, vitalSign} from './display-grouping';\nimport {bloodPressureLoincs} from './resource-code-manager-exports';\n\nimport {LOINCCode} from './loinc-code';\nimport {RXNORM_CODES, RxNormCode} from './rx-norm';\nimport {RxNormCodeGroup} from './rx-norm-group';\n\n// We declare a new LOINCCode referencing a DocumentReference, but do not\n// include it in the groupings below because it is not graphed/displayed in the\n// configuration sidebar.\nexport const documentReferenceLoinc =\n new LOINCCode('68608-9', undefined, 'Summary', true);\n\nconst ovaAndParasiteExam = new BCHMicrobioCode(\n 'OVAANDPARASITEEXAM', microbio, 'Ova and Parasite Exam', false);\n\nconst salmonella = new BCHMicrobioCode(\n 'SALMONELLAANDSHIGELLACULTURE', microbio, 'Salmonella and Shigella Culture',\n false);\n\n/**\n * ResourceCodeManager is the centralized class where other components can\n * look to find an exhaustive listing of all the resource code groups that the\n * application may display.\n */\n@Injectable()\nexport class ResourceCodeManager {\n private static axisGroups: AxisGroup[];\n private static displayGroupMapping: Map;\n\n\n static readonly labLoincs = [\n // Pull all the defaults to the top.\n new LOINCCode(\n '1988-5', labResult, 'C-Reactive Protein', true, [0, 100], true),\n new LOINCCode(\n '4537-7', labResult, 'ESR (Erythrocyte Sedimentation Rate)', true,\n [0, 200]),\n new LOINCCode('3094-0', labResult, 'BUN', true),\n new LOINCCode('2160-0', labResult, 'Creatinine', true),\n new LOINCCode('1742-6', labResult, 'ALT', true),\n new LOINCCode(\n '1920-8', labResult, 'AST (Aspartate Aminotransferase)', true),\n new LOINCCode('6768-6', labResult, 'Alkaline Phosphatase', true),\n new LOINCCode('1968-7', labResult, 'Bilirubin, Direct', true),\n new LOINCCode('1975-2', labResult, 'Bilirubin, Total', true),\n new LOINCCode('3084-1', labResult, 'Uric acid', false)\n ];\n\n private static readonly vitalLoincs = [\n new LOINCCode('8310-5', vitalSign, 'Temperature', true, [35, 41]),\n new LOINCCode('8867-4', vitalSign, 'Heart Rate', true, [20, 300]),\n new LOINCCode('9279-1', vitalSign, 'Respiratory Rate', true, [6, 100]),\n new LOINCCode(\n '59408-5', vitalSign, 'Oxygen Saturation (SpO2)', true, [5, 100], true)\n ];\n\n /**\n * Although these two measurements have independent LOINC codes they only ever\n * appear as sub-measurements of the larger entity for \"blood pressure\" in the\n * way that BCH data shows up.\n */\n private static readonly diastolicBP = new LOINCCode(\n '8462-4', vitalSign, 'Diastolic Blood Pressure', true, [25, 150]);\n private static readonly systolicBP = new LOINCCode(\n '8480-6', vitalSign, 'Systolic Blood Pressure', true, [30, 250]);\n\n // \"bloodPressureLoincs\" is in file resource-code-manager-exports.ts because\n // of circular dependency issues.\n\n private static readonly gentMonitoring = [\n new LOINCCode('31091-2', labResult, 'Gentamicin, Peak/Post Q24H'),\n new LOINCCode('3663-2', labResult, 'Gentamicin, Peak/Post Q8H'),\n new LOINCCode('31092-0', labResult, 'Gentamicin, Trough/Pre Q24H'),\n new LOINCCode('3665-7', labResult, 'Gentamicin, Trough/Pre Q8H')\n ];\n\n private static readonly vancMonitoring = [\n new LOINCCode('20578-1', labResult, 'Vancomycin Level, Random', true),\n new LOINCCode('4092-3', labResult, 'Vancomycin Level, Trough/Pre', true),\n ];\n\n private static readonly urineGroup = [\n new LOINCCode('5769-5', labResult, 'Bacteria, Urinalysis'),\n new LOINCCode('50551-1', labResult, 'Bilirubin, Urinalysis'),\n new LOINCCode('5794-3', labResult, 'Blood, Urinalysis'),\n new LOINCCode('21033-6', labResult, 'Budding Yeast, Urinalysis'),\n new LOINCCode('41865-7', labResult, 'Hyphal Yeast, Urinalysis'),\n new LOINCCode('25157-9', labResult, 'Epithelial Cast, Urinalysis'),\n new LOINCCode('50558-6', labResult, 'Nitrite, Urinalysis'),\n new LOINCCode('57735-3', labResult, 'Protein, Urinalysis'),\n new LOINCCode('58449-0', labResult, 'Red Blood Cell Clump, Urinalysis'),\n new LOINCCode('13945-1', labResult, 'Red Cells, Urinalysis'),\n new LOINCCode('11277-1', labResult, 'Squamous Epithelial, Urinalysis'),\n new LOINCCode('50563-6', labResult, 'Urobilinogen, Urinalysis'),\n new LOINCCode('5799-2', labResult, 'WBC Enzyme, Urinalysis'),\n new LOINCCode('33825-1', labResult, 'White Blood Cell Clump, Urinalysis'),\n new LOINCCode('20408-1', labResult, 'White Cells, Urinalysis'),\n ];\n\n private static readonly csfGroup = [\n new LOINCCode('10333-3', labResult, 'Appearance, CSF', false, [0, 100]),\n new LOINCCode('13517-8', labResult, 'Atypical Lymph, CSF', false, [0, 100]),\n new LOINCCode('12278-8', labResult, 'Band, CSF', false, [0, 100]),\n new LOINCCode('30374-3', labResult, 'Basophil, CSF', false, [0, 100]),\n new LOINCCode('12208-5', labResult, 'Eosinophil, CSF', false, [0, 100]),\n new LOINCCode('2342-4', labResult, 'Glucose, CSF', false, [0, 100]),\n new LOINCCode('10328-3', labResult, 'Lymphocyte, CSF', false, [0, 100]),\n new LOINCCode('10329-1', labResult, 'Monocyte, CSF', false, [0, 100]),\n new LOINCCode('12278-8', labResult, 'Neutrophil/Band, CSF', false, [0, 100])\n ];\n\n private static readonly otherFluidGroup = [\n new LOINCCode('9335-1', labResult, 'Appearance, Other Fluid'),\n new LOINCCode(\n '31208-2', labResult, 'Cell Count Source, Other Fluid', false,\n [0, 100000]),\n new LOINCCode(\n '47938-6', labResult, 'Cell Count, Other Source', false, [0, 100000]),\n new LOINCCode('38256-4', labResult, 'Cells Counted, Other Fluid'),\n new LOINCCode('6824-7', labResult, 'Color, Other Fluid'),\n new LOINCCode('12209-3', labResult, 'Eosinophil, Other Fluid')\n ];\n\n private static stoolGroupMB = [\n new BCHMicrobioCode(\n 'CDIFFICILEEIAWRFLXTOAMPLIFIEDDNA', microbio,\n 'C difficile EIA w/rflx to amplified DNA', true),\n new BCHMicrobioCode(\n 'CAMPYLOBACTERCULTURE', microbio, 'Campylobacter Culture', true),\n new BCHMicrobioCode(\n 'ENTEROHEMORRHAGICECOLITEST', microbio, 'Enterohemorrhagic E coli Test',\n true),\n new BCHMicrobioCode(\n 'SALMONELLAANDSHIGELLACULTURE', microbio,\n 'Salmonella and Shigella Culture', true),\n new BCHMicrobioCode('YERSINIACULTURE', microbio, 'Yersinia Culture', true),\n ];\n\n // Visible for testing.\n static respiratoryGroupMB = [\n new BCHMicrobioCode(\n 'ADENOVIRUSPCRRESPQUAL', microbio, 'Adenovirus PCR, Resp, QuaL', true),\n new BCHMicrobioCode(\n 'INFLUENZAABRSVPCRWASUBTYPEQUAL', microbio,\n 'Influenza A/B, RSV PCR w/A Subtype, QuaL', true),\n new BCHMicrobioCode(\n 'RESPIRATORYCULTUREANDGRAMSTAIN', microbio,\n 'Respiratory Culture and Gram Stain', true),\n new BCHMicrobioCode(\n 'VIRALDFARESPIRATORY', microbio, 'Viral DFA Respiratory', true),\n new BCHMicrobioCode(\n 'PARAINFLUENZA1DFA', microbio, 'Parainfluenza 1 DFA', true),\n new BCHMicrobioCode(\n 'PARAINFLUENZA123DFA', microbio, 'Parainfluenza 1, 2, 3 DFA', true),\n new BCHMicrobioCode(\n 'PARAINFLUENZA2DFA', microbio, 'Parainfluenza 2 DFA', true),\n new BCHMicrobioCode(\n 'PARAINFLUENZA3DFA', microbio, 'Parainfluenza 3 DFA', true),\n ];\n\n // Visible for testing.\n static otherGroupMB = [\n new BCHMicrobioCode(\n 'AFBCULTUREANDSTAIN', microbio, 'AFB Culture and Stain', true),\n new BCHMicrobioCode(\n 'ANAEROBICCULTURE', microbio, 'Anaerobic Culture', true),\n new BCHMicrobioCode(\n 'ASPERGILLUSGALACTOMANNANEIA', microbio,\n 'Aspergillus galactomannan EIA', true),\n new BCHMicrobioCode(\n 'CMVSHELLVIALCULTURE', microbio, 'CMV Shell Vial Culture', true),\n new BCHMicrobioCode(\n 'CATHETERTIPTUBINGFOREIGNBODYCULTURE', microbio,\n 'Catheter Tip/Tubing/Foreign Body Culture', true),\n new BCHMicrobioCode(\n 'FLUIDCULTUREANDGRAMSTAIN', microbio, 'Fluid Culture and Gram Stain',\n true),\n new BCHMicrobioCode('FUNGUSCULTURE', microbio, 'Fungus Culture', true),\n new BCHMicrobioCode('KOHFUNGALSTAIN', microbio, 'KOH Fungal Stain', true),\n new BCHMicrobioCode(\n 'TISSUECULTUREANDGRAMSTAIN', microbio, 'Tissue Culture and Gram Stain',\n true),\n new BCHMicrobioCode('VZVDFA', microbio, 'VZV DFA', true),\n new BCHMicrobioCode(\n 'VIRALCULTURENONRESPIRATORY', microbio,\n 'Viral Culture, Non Respiratory', true),\n new BCHMicrobioCode(\n 'WOUNDCULTUREANDGRAMSTAIN', microbio, 'Wound Culture and Gram Stain',\n true),\n new BCHMicrobioCode('HSVDFA', microbio, 'HSV DFA', true),\n new BCHMicrobioCode(\n 'HERPESSIMPLEXVIRUS12PCRQUAL', microbio,\n 'Herpes Simplex Virus 1/2 PCR, QuaL', true),\n ];\n\n private static bloodGroupMB = [\n new BCHMicrobioCode(\n 'ADENOVIRUSPCRQUANT', microbio, 'Adenovirus PCR, QuaNT', true),\n new BCHMicrobioCode(\n 'BLOODCULTUREROUTINEAEROBIC', microbio,\n 'Blood Culture Routine, Aerobic', true),\n new BCHMicrobioCode(\n 'BLOODCULTUREAEROBICANDANAEROBIC', microbio,\n 'Blood Culture, Aerobic and Anaerobic', true),\n new BCHMicrobioCode(\n 'BLOODCULTUREFUNGUS', microbio, 'Blood Culture, Fungus', true),\n new BCHMicrobioCode(\n 'CYTOMEGALOVIRUSPCRQUANT', microbio, 'Cytomegalovirus PCR, QuaNT',\n true),\n new BCHMicrobioCode(\n 'EPSTEINBARRVIRUSPCRQUANT', microbio, 'Epstein-Barr Virus PCR, QuaNT',\n true),\n ];\n\n private static csfGroupMB = [\n new BCHMicrobioCode(\n 'CSFCULTUREANDGRAMSTAIN', microbio, 'CSF Culture and Gram Stain', true),\n new BCHMicrobioCode(\n 'ENTEROVIRUSPCRCSFQUAL', microbio, 'Enterovirus PCR, CSF, QuaL', true)\n ];\n\n private static typeToPairs: Array<[DisplayGrouping, LOINCCode[]]> = [\n [vitalSign, ResourceCodeManager.vitalLoincs],\n [labResult, ResourceCodeManager.labLoincs],\n ];\n\n constructor(\n private fhirService: FhirService, private sanitizer: DomSanitizer) {\n if (ResourceCodeManager.axisGroups) {\n return;\n }\n\n\n const codeGroups = new Array();\n // All the labs and vitals are linecharts and displayed on\n // independent axes.\n for (const [conceptGroup, codePairs] of ResourceCodeManager.typeToPairs) {\n for (const loinc of codePairs) {\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, loinc.label, new Array(loinc), conceptGroup,\n ChartType.LINE),\n loinc.label)]));\n }\n }\n\n const bpLocation = new LOINCCodeGroup(\n this.fhirService, 'Blood Pressure Details',\n [new LOINCCode('41904-4', vitalSign, 'Blood Pressure Location', true)],\n vitalSign, ChartType.SCATTER);\n // Add the blood pressure LOINCs.\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, 'Blood Pressure',\n bloodPressureLoincs, vitalSign, ChartType.LINE,\n (observation: Observation, dateRange: Interval):\n Promise => {\n return bpLocation.getResourceSet(dateRange).then(obsSet => {\n return AnnotatedObservation.forBloodPressure(\n observation,\n // We only pass in the first ObservationSet, since we\n // know there is only one code whose observations we\n // care about.\n obsSet[0]);\n });\n }),\n 'Blood Pressure')]));\n\n const cbc = [\n new LOINCCodeGroup(\n this.fhirService, 'WBC',\n [new LOINCCode('26464-8', labResult, 'WBC', false, [0, 150])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Hemoglobin',\n [new LOINCCode('718-7', labResult, 'Hemoglobin', false, [0.5, 30])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Hematocrit',\n [new LOINCCode('4544-3', labResult, 'Hematocrit', false, [10, 70])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Platelet',\n [new LOINCCode('777-3', labResult, 'Platelet', false, [2, 900])],\n labResult, ChartType.LINE),\n ];\n\n codeGroups.push(new AxisGroup(\n cbc.map(\n codeGroup => new Axis(\n this.fhirService, this.sanitizer, codeGroup, codeGroup.label)),\n 'Complete Blood Count'));\n\n const cbcWBC = [\n new LOINCCodeGroup(\n this.fhirService, 'Neutrophil/Band',\n [new LOINCCode(\n '35332-6', labResult, 'Neutrophil/Band', true, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Immature Granulocytes',\n [new LOINCCode(\n '38518-7', labResult, 'Immature Granulocytes', false, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Lymphocyte',\n [new LOINCCode('736-9', labResult, 'Lymphocyte', false, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Monocyte',\n [new LOINCCode('5905-5', labResult, 'Monocyte', false, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Eosinophil',\n [new LOINCCode('713-8', labResult, 'Eosinophil', false, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Basophil',\n [new LOINCCode('706-2', labResult, 'Basophil', false, [0, 100])],\n labResult, ChartType.LINE),\n\n ];\n codeGroups.push(new AxisGroup(\n cbcWBC.map(\n codeGroup => new Axis(\n this.fhirService, this.sanitizer, codeGroup, codeGroup.label)),\n 'Complete Blood Count White Blood Cell'));\n\n const medsSummaryGroup = RXNORM_CODES;\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new RxNormCodeGroup(\n this.fhirService, 'Vancomycin & Gentamicin Summary',\n medsSummaryGroup, med, ChartType.STEP),\n 'Vancomycin & Gentamicin Summary')]));\n\n // Drug monitoring should be a scatterplot, and the related concepts\n // should be displayed on the same axes.\n const vancRxNorm = new RxNormCodeGroup(\n this.fhirService, 'Administrations',\n [RxNormCode.fromCodeString('11124')], med, ChartType.SCATTER);\n\n // Drug monitoring should be a scatterplot, and the related concepts\n // should be displayed on the same axes.\n const vancMonitoring = [\n vancRxNorm,\n new LOINCCodeGroup(\n this.fhirService, 'Monitoring', ResourceCodeManager.vancMonitoring,\n med, ChartType.SCATTER,\n (observation: Observation, dateRange: Interval):\n Promise => {\n return vancRxNorm.getResourceSet(dateRange).then(rxNorms => {\n // We know that we're only pushing in one RxNorm\n // so it's safe to grab the first (and only) one in\n // the list.\n return AnnotatedObservation.forMedicationMonitoring(\n observation, rxNorms[0].orders);\n });\n })\n ];\n\n codeGroups.push(new AxisGroup(\n vancMonitoring.map(\n codeGroup => new Axis(\n this.fhirService, this.sanitizer, codeGroup, codeGroup.label)),\n 'Vancomycin'));\n\n const gentMonitoring = [\n new RxNormCodeGroup(\n this.fhirService, 'Administrations',\n [RxNormCode.fromCodeString('1596450')], med, ChartType.SCATTER),\n new LOINCCodeGroup(\n this.fhirService, 'Monitoring', ResourceCodeManager.gentMonitoring,\n med, ChartType.SCATTER)\n ];\n\n codeGroups.push(new AxisGroup(\n gentMonitoring.map(\n codeGroup => new Axis(\n this.fhirService, this.sanitizer, codeGroup, codeGroup.label)),\n 'Gentamicin'));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, 'Urinalysis', ResourceCodeManager.urineGroup,\n labResult, ChartType.SCATTER),\n 'Urinalysis')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, 'CSF', ResourceCodeManager.csfGroup, labResult,\n ChartType.SCATTER),\n 'CSF')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, 'Other Fluid',\n ResourceCodeManager.otherFluidGroup, labResult, ChartType.SCATTER),\n 'Other Fluid')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'Stool', ResourceCodeManager.stoolGroupMB,\n microbio, ChartType.MICROBIO),\n 'Stool')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'Respiratory',\n ResourceCodeManager.respiratoryGroupMB, microbio,\n ChartType.MICROBIO),\n 'Respiratory')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'Other', ResourceCodeManager.otherGroupMB,\n microbio, ChartType.MICROBIO),\n 'Other')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'Blood', ResourceCodeManager.bloodGroupMB,\n microbio, ChartType.MICROBIO),\n 'Blood')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'CSF Microbiology',\n ResourceCodeManager.csfGroupMB, microbio, ChartType.MICROBIO),\n 'CSF Microbiology')]));\n\n ResourceCodeManager.axisGroups = codeGroups;\n\n const mapping = new Map();\n for (const group of this.getResourceCodeGroups()) {\n if (mapping.has(group.displayGroup)) {\n mapping.get(group.displayGroup).push(group);\n } else {\n mapping.set(group.displayGroup, [group]);\n }\n }\n ResourceCodeManager.displayGroupMapping = mapping;\n }\n\n /**\n * Returns the ResourceCodeGroups to be displayed. If the maps have already\n * been constructed, returns the static variable holding the information.\n * If not, constructs the maps and saves them into the static class variable,\n * then returns.\n */\n getResourceCodeGroups(): AxisGroup[] {\n return ResourceCodeManager.axisGroups;\n }\n\n /**\n * Returns a map where the key is a clinical concept group and the value is\n * a list of LOINC code groups belonging to the clinical concept group.\n */\n getDisplayGroupMapping(): Map {\n return ResourceCodeManager.displayGroupMapping;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Interval} from 'luxon';\nimport {CachedResourceCodeGroup} from '../clinicalconcepts/resource-code-group';\nimport {MedicationAdministration} from '../fhir-data-classes/medication-administration';\nimport {MedicationOrder, MedicationOrderSet, MedicationOrderStatus} from '../fhir-data-classes/medication-order';\n\nimport {RxNormCode} from './rx-norm';\n\n/**\n * Represents one or more RxNorm codes that should be displayed together. In the\n * case of multiple RxNorm codes in a group, you should provide a label for that\n * group.\n */\nexport class RxNormCodeGroup extends\n CachedResourceCodeGroup {\n medicationOrderCache = new Map();\n\n /**\n * Gets all Medication Administrations in this group from FHIR for the given\n * date range.\n * @param dateRange date range to get medication administrations for\n */\n getResourceFromFhir(dateRange: Interval):\n Promise {\n return this.fhirService.getMedicationAdministrationsWithCodes(\n this, dateRange);\n }\n\n /**\n * Fills out the order and administration information for each\n * RxNormCode in this group, and returns a list of the populated RxNormCodes.\n * This is a roundabout process because the Cerner implementation of the\n * FHIR standard doesn't allow for searching MedicationOrders by RxNorm code,\n * so we have to search for MedicationAdministrations by RxNorm code and work\n * up from there.\n */\n formatRawResults(rawResults: MedicationAdministration[]):\n Promise {\n const groupedByOrder = this.groupAdministrationsByOrderId(rawResults);\n return this.getMedicationOrdersAndMapToMed(groupedByOrder);\n }\n\n /**\n * Takes a list of lists of MedicationAdministrations and groups them by their\n * order IDs. Each list represents a set of MedicationAdministrations for a\n * specific RxNorm, but they're not arranged by order. For example:\n *\n * [[admin1_rxnorm1_orderA, admin2_rxnorm1_orderB, admin3_rxnorm1_orderB],\n * [admin1_rxnorm2_orderC, admin2_rxnorm2_orderC],\n * [admin1_rxnorm3_orderD]]\n *\n * would yield:\n *\n * {orderA: [admin1_rxnorm1_orderA],\n * orderB: [admin2_rxnorm1_orderB, admin3_rxnorm1_orderB],\n * orderC: [admin1_rxnorm2_orderC, admin2_rxnorm2_orderC],\n * orderD: [admin1_rxnorm3_orderD]\n * }\n * @param medAdmins A list of lists of MedicationAdministrations. See above.\n * @returns A map of order IDs to a list of corresponding\n * MedicationAdministrations.\n */\n private groupAdministrationsByOrderId(medAdmins: MedicationAdministration[]):\n Map {\n let groupedByOrder = new Map();\n // Group medication administrations by medication order.\n groupedByOrder = medAdmins.reduce(\n (groups: Map,\n medAdmin: MedicationAdministration) => {\n // Append this administration to whatever order list it belongs to.\n const orderId: string = medAdmin.medicationOrderId;\n if (!groups.has(orderId)) {\n groups.set(orderId, new Array());\n }\n groups.set(orderId, groups.get(orderId).concat(medAdmin));\n return groups;\n },\n // Use whatever existed in groupedByOrder prior to this iteration as\n // the basis for the reducer to add to.\n groupedByOrder);\n\n return groupedByOrder;\n }\n\n /**\n * Transforms a map with keys of MedicationOrder IDs and values of\n * MedicationAdministrations to a list of RxNormCodes, with the RxNormCodes\n * containing their corresponding MedicationOrders, and the medicationOrders\n * containing their corresponding MedicationAdministrations. For example:\n *\n * {orderA: [admin1_rxnorm1_orderA],\n * orderB: [admin2_rxnorm1_orderB, admin3_rxnorm1_orderB],\n * orderC: [admin1_rxnorm2_orderC, admin2_rxnorm2_orderC],\n * orderD: [admin1_rxnorm3_orderD]\n * }\n *\n * would yield:\n *\n * [RxNorm1 = {orders:\n * [OrderA {administrationsForOrder: [admin1_rxnorm1_orderA]},\n * OrderB {administrationsForOrder: [admin2_rxnorm1_orderB,\n * admin3_rxnorm1_orderB]}]}\n * RxNorm2 = {orders:\n * [OrderC {administrationsForOrder: [admin1_rxnorm2_orderC,\n * admin2_rxnorm2_orderC]}]}\n * RxNorm3 = {orders:\n * [OrderD {administrationsForOrder: [admin1_rxnorm3_orderD]}]}\n *\n * @param groupedByOrder A map with keys of MedicationOrder IDs and values of\n * MedicationAdministrations for those MedicationOrders.\n * @returns A list of RxNormCodes with orders populated\n * @throws Error if the incoming parameter has medication administrations that\n * did not come from the same order for the same med\n */\n private getMedicationOrdersAndMapToMed(\n groupedByOrder: Map):\n Promise {\n const groupedByMed = new Map();\n const allPromises = Array.from(groupedByOrder.keys()).map(orderId => {\n if (this.medicationOrderCache.has(orderId)) {\n return Promise.resolve(this.medicationOrderCache.get(orderId));\n } else {\n return this.fhirService.getMedicationOrderWithId(orderId).then(\n order => {\n // We only have the MedicationAdministrations from within the\n // specified time window, so we have to search again for all the\n // MedicationAdministrations present for this order and assign\n // them to the order.\n // We assume that an administration will always have a\n // corresponding order.\n return order.setMedicationAdministrations(this.fhirService)\n .then(order => {\n // if this order will not have any additional data added,\n // we add it to the medication order cache.\n if (order.status === MedicationOrderStatus.COMPLETED ||\n order.status === MedicationOrderStatus.STOPPED) {\n this.medicationOrderCache.set(orderId, order);\n }\n return order;\n });\n },\n rejection => {\n // If there are any errors constructing MedicationOrders for\n // this RxNormCode[], throw the error.\n throw rejection;\n });\n }\n });\n\n // Resolve all the promises and set the corresponding orders for each\n // RxNorm.\n return Promise.all(allPromises)\n .then(orders => {\n orders.map(\n (order: MedicationOrder) => {\n // Verify all the administrations have the same RxNormCode and\n // same Order ID.\n const rxNormCodeSet = new Set(\n Array.from(groupedByOrder.get(order.orderId).values())\n .map(admin => admin.rxNormCode));\n if (rxNormCodeSet.size !== 1) {\n throw Error(\n 'Administrations for order ' + order.orderId +\n ' are for multiple RxNorms: ' +\n Array.from(rxNormCodeSet.values()));\n }\n\n const orderSet = new Set(\n Array.from(groupedByOrder.get(order.orderId).values())\n .map(admin => admin.medicationOrderId));\n if (rxNormCodeSet.size !== 1) {\n throw Error(\n 'Administrations for order ' + order.orderId +\n ' report multiple order IDs: ' + Array.from(orderSet));\n }\n\n // Add the order to the map for the RxNorm code.\n const rxCode = rxNormCodeSet.values().next().value;\n if (groupedByMed.has(rxCode)) {\n groupedByMed.set(\n rxCode, groupedByMed.get(rxCode).concat(order));\n } else {\n groupedByMed.set(rxCode, new Array(order));\n }\n },\n rejection => {\n // If there are any errors constructing MedicationOrders for\n // this RxNormCode[], throw the error.\n throw rejection;\n });\n })\n .then(\n _ => {\n Array.from(groupedByMed.entries()).forEach(medEntry => {\n const rxNorm = medEntry[0];\n const medOrders = medEntry[1];\n rxNorm.orders = new MedicationOrderSet(medOrders);\n });\n // Return all the populated RxNorms.\n return Array.from(groupedByMed.keys());\n },\n rejection => {\n // If any promise is rejected, throw the same rejection.\n throw rejection;\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {APP_TIMESPAN} from 'src/constants';\n\nimport {ResourceCode} from '../clinicalconcepts/resource-code-group';\nimport {MedicationOrderSet} from '../fhir-data-classes/medication-order';\nimport {FhirService} from '../fhir.service';\nimport * as Colors from '../theme/verily_colors';\n\nimport {DisplayGrouping} from './display-grouping';\n\nexport class MedicationConceptGroup extends DisplayGrouping {}\n\nexport const ANTIBIOTIC =\n new MedicationConceptGroup('Antibiotic', Colors.DEEP_TURQUOISE);\n\nexport const MEDICATION_GROUPS = [ANTIBIOTIC];\n\n/**\n * Holds RXNorm codes and orders corresponding to them.\n */\nexport class RxNormCode extends ResourceCode {\n static readonly CODING_STRING = 'http://www.nlm.nih.gov/research/umls/rxnorm';\n\n /* Contains a set of medication orders for this RxNorm code. */\n orders: MedicationOrderSet;\n\n dataAvailableInAppTimeScope(fhirService: FhirService): Promise {\n return fhirService.medicationsPresentWithCode(this, APP_TIMESPAN);\n }\n}\n\nexport const RXNORM_CODES = [\n // Parenteral antibiotics\n new RxNormCode('11124', ANTIBIOTIC, 'Vancomycin', true),\n new RxNormCode('1596450', ANTIBIOTIC, 'Gentamicin')\n];\n","module.exports = \".previewSave {\\n background-color:#202020; /* GREY_900 */\\n display: -webkit-box;\\n display: flex;\\n padding: 15px;\\n width: 90%;\\n overflow: auto;\\n max-height: 80%;\\n /* Disable selecting/highlighting on the page. */\\n -webkit-touch-callout: none; /* iOS Safari */\\n -webkit-user-select: none; /* Safari */\\n -moz-user-select: none; /* Firefox */\\n -ms-user-select: none; /* Internet Explorer/Edge */\\n user-select: none; /* Chrome and Opera */\\n}\\n\\n::ng-deep .previewSave > * {\\n pointer-events: none !important;\\n}\\n\\n.mat-dialog-actions {\\n float: right;\\n}\\n\\nh1 {\\n font-family: 'Montserrat', sans-serif;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY29uZmlybS1zYXZlL2NvbmZpcm0tc2F2ZS5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0Usd0JBQXdCLEVBQUUsYUFBYTtFQUN2QyxvQkFBYTtFQUFiLGFBQWE7RUFDYixhQUFhO0VBQ2IsVUFBVTtFQUNWLGNBQWM7RUFDZCxlQUFlO0VBQ2YsZ0RBQWdEO0VBQ2hELDJCQUEyQixFQUFFLGVBQWU7RUFDNUMseUJBQXlCLEVBQUUsV0FBVztLQUNuQyxzQkFBc0IsRUFBRSxZQUFZO01BQ25DLHFCQUFxQixFQUFFLDJCQUEyQjtVQUM5QyxpQkFBaUIsRUFBRSxxQkFBcUI7QUFDbEQ7O0FBRUE7RUFDRSwrQkFBK0I7QUFDakM7O0FBRUE7RUFDRSxZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxxQ0FBcUM7QUFDdkMiLCJmaWxlIjoic3JjL2FwcC9jb25maXJtLXNhdmUvY29uZmlybS1zYXZlLmNvbXBvbmVudC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIucHJldmlld1NhdmUge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiMyMDIwMjA7IC8qIEdSRVlfOTAwICovXG4gIGRpc3BsYXk6IGZsZXg7XG4gIHBhZGRpbmc6IDE1cHg7XG4gIHdpZHRoOiA5MCU7XG4gIG92ZXJmbG93OiBhdXRvO1xuICBtYXgtaGVpZ2h0OiA4MCU7XG4gIC8qIERpc2FibGUgc2VsZWN0aW5nL2hpZ2hsaWdodGluZyBvbiB0aGUgcGFnZS4gKi9cbiAgLXdlYmtpdC10b3VjaC1jYWxsb3V0OiBub25lOyAvKiBpT1MgU2FmYXJpICovXG4gIC13ZWJraXQtdXNlci1zZWxlY3Q6IG5vbmU7IC8qIFNhZmFyaSAqL1xuICAgICAtbW96LXVzZXItc2VsZWN0OiBub25lOyAvKiBGaXJlZm94ICovXG4gICAgICAtbXMtdXNlci1zZWxlY3Q6IG5vbmU7IC8qIEludGVybmV0IEV4cGxvcmVyL0VkZ2UgKi9cbiAgICAgICAgICB1c2VyLXNlbGVjdDogbm9uZTsgLyogQ2hyb21lIGFuZCBPcGVyYSAqL1xufVxuXG46Om5nLWRlZXAgLnByZXZpZXdTYXZlID4gKiB7XG4gIHBvaW50ZXItZXZlbnRzOiBub25lICFpbXBvcnRhbnQ7XG59XG5cbi5tYXQtZGlhbG9nLWFjdGlvbnMge1xuICBmbG9hdDogcmlnaHQ7XG59XG5cbmgxIHtcbiAgZm9udC1mYW1pbHk6ICdNb250c2VycmF0Jywgc2Fucy1zZXJpZjtcbn0iXX0= */\"","module.exports = \"

\\n Save a static image of this page to a PowerChart clinical note?\\n

\\n
Preview:
\\n
\\n
\\n \\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {AfterViewInit, Component, Inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material';\n\n@Component({\n selector: 'app-confirm-save',\n templateUrl: './confirm-save.component.html',\n styleUrls: ['./confirm-save.component.css']\n})\nexport class ConfirmSaveComponent implements AfterViewInit {\n innerHtml: string;\n constructor(\n public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) readonly data: HTMLCanvasElement) {}\n\n ngAfterViewInit() {\n this.data.setAttribute('id', 'previewImg');\n this.data.setAttribute('style', 'width:500px');\n document.getElementById('previewCanvas').appendChild(this.data);\n }\n\n // The user does not wish to save the snapshot.\n onExit() {\n this.dialogRef.close();\n }\n\n // The user wishes to save the snapshot.\n onConfirm() {\n this.dialogRef.close({\n save: true,\n });\n }\n}\n","module.exports = \".configurationCard {\\n background-color: transparent;\\n border-left-style: solid;\\n border-left-width: 5px;\\n height: 40px !important;\\n padding: 3px;\\n}\\n\\n\\n.disableDragging {\\n color: gray;\\n cursor: not-allowed;\\n padding-top: 4px;\\n}\\n\\n\\n.listItem {\\n display: inline-block;\\n height: -webkit-fit-content;\\n height: -moz-fit-content;\\n height: fit-content;\\n padding-left: 5px !important;\\n}\\n\\n\\n.label {\\n height: -webkit-fit-content;\\n height: -moz-fit-content;\\n height: fit-content;\\n line-height: 15px;\\n}\\n\\n\\n.tinytext {\\n font-size: 12px;\\n line-height: 15px;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvZGF0YS1zZWxlY3Rvci1lbGVtZW50L2RhdGEtc2VsZWN0b3ItZWxlbWVudC5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UsNkJBQTZCO0VBQzdCLHdCQUF3QjtFQUN4QixzQkFBc0I7RUFDdEIsdUJBQXVCO0VBQ3ZCLFlBQVk7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G4iXX0= */\"","module.exports = \"
\\n \\n \\n
\\n
\\n
\\n {{axisGroup.label}}\\n
\\n
\\n {{uiConstants.NO_DATA_AVAILABLE_TMPL + appTimeIntervalString}}\\n
\\n
\\n
\\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {AfterViewInit, Component, Inject, Input} from '@angular/core';\nimport {APP_TIMESPAN, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {AxisGroup} from '../graphtypes/axis-group';\n\n/**\n * Represents one element in a list or menu of ResourceCodesForCards\n * that can be added to the main CardContainer.\n */\n@Component({\n selector: 'app-data-selector-element',\n templateUrl: './data-selector-element.component.html',\n styleUrls: ['./data-selector-element.component.css']\n})\nexport class DataSelectorElementComponent implements AfterViewInit {\n /**\n * The ResourceCodes for the card represented by this DataSelectorElement.\n */\n @Input() axisGroup: AxisGroup;\n\n /**\n * Hold an instance of the app time interval so we can display it in the HTML\n */\n readonly appTimeIntervalString = APP_TIMESPAN.start.toFormat('MM/dd/yyyy') +\n ' and ' + APP_TIMESPAN.end.toFormat('MM/dd/yyyy');\n\n /**\n * Whether there is data available within the app timespan for this card.\n */\n dataAvailable = true;\n\n constructor(@Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n ngAfterViewInit() {\n // We have to wait until after view initialization so that the @Input\n // element binding happens.\n this.axisGroup.dataAvailableInAppTimeScope().then(available => {\n this.dataAvailable = available;\n });\n }\n}\n","module.exports = \".addCardInline {\\n color: rgb(248, 248, 248);\\n display: inline-block;\\n opacity: 0.15;\\n -webkit-transition: opacity 0.3s;\\n transition: opacity 0.3s;\\n /* Needed so that there's not enough space between the cards to hold the icon,\\n just enough to hold the line placeholder.*/\\n margin-bottom:-14px;\\n margin-top:-14px;\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n flex-direction: row; /* For IE10 */\\n align-content: center;\\n -ms-flex-line-pack: center; /* Align content: center conversion for IE10 */\\n -webkit-box-pack: start;\\n justify-content: flex-start;\\n -ms-flex-pack: start; /* Justify content: start conversion for IE10 */\\n -webkit-box-align: center;\\n align-items: center;\\n -ms-flex-align: center; /* Align items: center conversion for IE10 */\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n}\\n\\nspan {\\n border: 2px dashed rgb(248, 248, 248);\\n /* Only outline the bottom instead of all four sides.*/\\n border-style: none none dotted;\\n display: inline-block;\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n}\\n\\n.addCardInline:hover {\\n opacity: 1;\\n}\\n\\n.conceptSelector {\\n padding-left: 0px !important;\\n padding-right: 0px !important;\\n min-width: 200px;\\n}\\n\\n.mainConceptSelector {\\n border-left-style: solid;\\n border-left-width: 5px;\\n}\\n\\n::ng-deep .mat-menu-item {\\n line-height: 20px !important;\\n}\\n\\n::ng-deep .mat-list-item-content {\\n margin-top: 8px;\\n}\\n\\n::ng-deep .mat-autocomplete-panel .mat-list-item-content {\\n margin-top: -8px; /* Styling for autocomplete menu items needs to be different.*/\\n}\\n\\n::ng-deep .mat-option {\\n height: -webkit-fit-content !important;\\n height: -moz-fit-content !important;\\n height: fit-content !important;\\n overflow: visible !important;\\n padding: 0px !important;\\n}\\n\\n.conceptForm {\\n margin-left: 10px;\\n margin-right: 10px;\\n}\\n\\n::ng-deep .autoMenu.mat-menu-panel {\\n min-width: 300px;\\n}\\n\\n.conceptFormField {\\n width: 100%;\\n}\\n\\nbutton {\\n font-family: 'Work Sans', sans-serif;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvZGF0YS1zZWxlY3Rvci1tZW51L2RhdGEtc2VsZWN0b3ItbWVudS5jb21wb25lbnQuY3NzIl0sIm5hb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hdXRvY29tcGxldGUtcGFuZWwgLm1hdC1saXN0LWl0ZW0tY29udGVudCB7XG4gIG1hcmdpbi10b3A6IC04cHg7IC8qIFN0eWxpbmcgZm9yIGF1dG9jb21wbGV0ZSBtZW51IGl0ZW1zIG5lZWRzIHRvIGJlIGRpZmZlcmVudC4qL1xufVxuXG46Om5nLWRlZXAgLm1hdC1vcHRpb24ge1xuICBoZWlnaHQ6IGZpdC1jb250ZW50ICFpbXBvcnRhbnQ7XG4gIG92ZXJmbG93OiB2aXNpYmxlICFpbXBvcnRhbnQ7XG4gIHBhZGRpbmc6IDBweCAhaW1wb3J0YW50O1xufVxuXG4uY29uY2VwdEZvcm0ge1xuICBtYXJnaW4tbGVmdDogMTBweDtcbiAgbWFyZ2luLXJpZ2h0OiAxMHB4O1xufVxuXG46Om5nLWRlZXAgLmF1dG9NZW51Lm1hdC1tZW51LXBhbmVsIHtcbiAgbWluLXdpZHRoOiAzMDBweDtcbn1cblxuLmNvbmNlcHRGb3JtRmllbGQge1xuICB3aWR0aDogMTAwJTtcbn1cblxuYnV0dG9uIHtcbiAgZm9udC1mYW1pbHk6ICdXb3JrIFNhbnMnLCBzYW5zLXNlcmlmO1xufSJdfQ== */\"","module.exports = \"
\\n \\n \\n \\n
\\n\\n \\n \\n \\n \\n \\n \\n\\n\\n \\n \\n \\n \\n \\n
\\n \\n \\n \\n search\\n \\n \\n \\n \\n \\n \\n \\n
\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, Inject, OnInit, Output, ViewChild} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {MatAutocompleteTrigger, MatMenuTrigger} from '@angular/material';\nimport {Observable} from 'rxjs';\nimport {map, startWith} from 'rxjs/operators';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\nimport {ResourceCodeManager} from '../clinicalconcepts/resource-code-manager';\nimport {AxisGroup} from '../graphtypes/axis-group';\n\n/**\n * Shows a button with expanding menus for selecting data elements to display.\n */\n@Component({\n selector: 'app-data-selector-menu',\n templateUrl: './data-selector-menu.component.html',\n styleUrls: ['./data-selector-menu.component.css']\n})\nexport class DataSelectorMenuComponent implements OnInit {\n // The trigger for the main menu displayed.\n @ViewChild(MatMenuTrigger) menuTrigger: MatMenuTrigger;\n // The trigger for the autocomplete panel displayed.\n @ViewChild(MatAutocompleteTrigger)\n autocompleteTrigger: MatAutocompleteTrigger;\n\n // An array of DisplayGroupings and AxisGroup that belong to that\n // grouping.\n readonly displayGroupings: Array<[DisplayGrouping, AxisGroup[]]>;\n\n // An event that is emitted when the user requests to add a new card.\n @Output() addCard = new EventEmitter();\n // An event that is emitted when the user requests to add a textbox.\n @Output() addTextbox = new EventEmitter();\n // An event that is emitted when the user requests to add a custom timeline.\n @Output() addCustomTimeline = new EventEmitter();\n\n // All AxisGroup that correspond to cards displayed on the page.\n readonly allConcepts: AxisGroup[];\n\n // The FormControl used to monitor changes in the user input of the\n // autocomplete field.\n readonly conceptCtrl = new FormControl();\n filteredConcepts: Observable;\n constructor(\n private resourceCodeManager: ResourceCodeManager,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n const displayGroups = resourceCodeManager.getDisplayGroupMapping();\n const temp = Array.from(displayGroups.values());\n this.allConcepts = [].concat.apply([], temp);\n this.displayGroupings = Array.from(displayGroups.entries());\n }\n\n ngOnInit() {\n // Watch for changes to the user input on the autocomplete panel.\n this.filteredConcepts = this.conceptCtrl.valueChanges.pipe(\n startWith(''), // The autocomplete input starts with nothing typed in.\n map(concept =>\n concept ? this.filter(concept) : this.allConcepts.slice()));\n }\n\n // Listens for an event indicating that the user has selected to add the\n // concept card from the top toolbar. The label for the card is sent as an\n // event to CardContainer.\n private addConceptCard(label: string) {\n this.addCard.emit(label);\n\n recordGoogleAnalyticsEvent('addConcept', 'addCard', label);\n }\n\n // Emits an event indicating to CardContainer to add a blank textbox at the\n // top of the page.\n private textbox() {\n this.addTextbox.emit();\n\n recordGoogleAnalyticsEvent(\n 'addTextbox', 'addCard', new Date().toDateString());\n }\n\n private customTimeline() {\n this.addCustomTimeline.emit();\n\n recordGoogleAnalyticsEvent(\n 'addCustomTimeline', 'addCard', new Date().toDateString());\n }\n\n // Filter the concepts shown on the autocomplete menu.\n filter(concept): AxisGroup[] {\n return this.allConcepts.filter(\n option =>\n option.label.toLowerCase().indexOf(concept.toLowerCase()) === 0);\n }\n\n // We close the menu after an option is selected by autocomplete.\n private closeMenus() {\n this.menuTrigger.closeMenu();\n this.autocompleteTrigger.closePanel();\n }\n\n // Listen for the event indicating that an option has been selected in the\n // autocomplete menu.\n private selectOption($event) {\n this.addConceptCard($event.option.value);\n this.closeMenus();\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Duration, Interval} from 'luxon';\n/**\n * For the given date range, returns a DateTime for each day in the time\n * range (converting to local time first) as a list in chronological\n * order. All data points in dateRange will be enclosed by the days listed in\n * the returned array. If specified, additional DateTimes will be included at\n * the 12-hour mark of each day in the interval.\n * @param dateRange The date range to get tick marks for.\n * @param twelveHour Whether or not to include DateTimes at the 12-hour mark of\n * each day.\n *\n * @returns A list of the days in chronological order within the time range.\n */\nexport function getTickMarksForXAxis(\n dateRange: Interval, twelveHour: boolean): DateTime[] {\n const days: DateTime[] = [];\n // The dateRange could be stored in UTC, so convert it back to local\n // time.\n const intervalLocal = Interval.fromDateTimes(\n dateRange.start.toLocal(), dateRange.end.toLocal());\n const startDate: DateTime = intervalLocal.start.startOf('day');\n const dayCount =\n Duration.fromMillis(intervalLocal.end.toMillis() - startDate.toMillis())\n .as('days');\n\n for (let i = 0; i <= dayCount; i++) {\n days.push(startDate.plus({days: i}));\n if (twelveHour) {\n days.push(startDate.plus({days: i, hours: 12}));\n }\n }\n\n return days;\n}\n\n/**\n * Returns a DateTime for each day contained in any of the intervals in the\n * passed-in interval set. If the interval set contains day-boundaries, it will\n * add an extra day to be sure to encompass the full day, like\n * getTickMarksForXAxis. The days returned will be in an array in time order.\n *\n * @param intervals The intervals to list all the days for.\n */\nexport function getDaysForIntervalSet(intervals: Interval[]): DateTime[] {\n const days: DateTime[] = [];\n const allIntervals = Interval.merge(intervals);\n for (const interval of allIntervals) {\n getTickMarksForXAxis(interval, false).forEach(x => days.push(x.toUTC()));\n }\n return days.sort();\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Injectable} from '@angular/core';\n\n/**\n * This service accumulates any errors sent to it in the app into an array of\n * strings so that they can be surfaced in the UI.\n */\n@Injectable({providedIn: 'root'})\nexport class DebuggerService {\n errors: string[] = [];\n\n logError(error: string) {\n this.errors.push(error);\n }\n}\n","module.exports = \"
\\n Browser version: {{browserVersion}}
\\n Authentication information:
\\n URL Parameters: {{parameters}}
\\n\\n Errors surfaced:
\\n
\\n {{error}}\\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nimport 'fhirclient';\n\nimport {Component} from '@angular/core';\nimport {ActivatedRoute} from '@angular/router';\n\nimport {DebuggerService} from '../debugger.service';\n\n@Component({\n selector: 'app-debugger',\n templateUrl: './debugger.component.html',\n})\n\n/**\n * This debugger component surfaces errors stored in the debug service to the\n * UI.\n */\nexport class DebuggerComponent {\n browserVersion: string;\n parameters = new Array();\n\n constructor(\n readonly debugService: DebuggerService, private route: ActivatedRoute) {\n this.browserVersion = navigator.appVersion;\n\n this.route.queryParams.subscribe(params => {\n this.parameters.push(JSON.stringify(params));\n });\n }\n}\n","module.exports = \"

{{uiConstants.REMOVE_CARD}}

\\n
\\n \\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, Inject} from '@angular/core';\nimport {MatDialogRef} from '@angular/material/dialog';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\n/**\n * Shows a dialog asking the user to confirm whether or not they wish to delete\n * the card.\n */\n@Component({\n selector: 'app-delete-dialog',\n templateUrl: './delete-dialog.component.html',\n styleUrls: ['../cardcontainer/cardcontainer.component.css']\n})\nexport class DeleteDialogComponent {\n constructor(\n public dialogRef: MatDialogRef,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n // The user does not wish to delete the card.\n onExit() {\n this.dialogRef.close();\n }\n\n // The user wishes to delete the card.\n onConfirm() {\n this.dialogRef.close({\n delete: true,\n });\n }\n}\n","// Copyright 2019 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\n\nimport {TimestampedObject} from '../fhir-resource-set';\nimport {DiagnosticReport} from './diagnostic-report';\n\n/**\n * A diagnostic report with the timestamp for a specific culture type extended.\n */\nexport class AnnotatedDiagnosticReport extends TimestampedObject {\n readonly report: DiagnosticReport;\n\n constructor(report: DiagnosticReport) {\n // Get the timestamp from the collection time of the specimen.\n const specimen = report.specimen;\n let timestamp;\n if (specimen) {\n timestamp = specimen.collectedDateTime ?\n specimen.collectedDateTime :\n (specimen.collectedPeriod ? specimen.collectedPeriod.start :\n undefined);\n }\n super(timestamp);\n this.report = report;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Duration, Interval} from 'luxon';\nimport {ResultClassWithTimestamp} from '../fhir-resource-set';\nimport {MedicationOrder, MedicationOrderSet} from './medication-order';\nimport {Observation} from './observation';\nimport {ObservationSet} from './observation-set';\n\n/**\n * An Observation with additional information to display in its tooltip.\n */\nexport class AnnotatedObservation extends ResultClassWithTimestamp {\n constructor(\n readonly observation: Observation,\n /**\n * The items in this list are [label, value] pairs to be displayed in\n * a tooltip.\n * This array should be treated as immutable.\n */\n readonly annotationValues = new Array<[string, string]>()) {\n super(observation.label, observation.requestId, observation.timestamp);\n }\n\n /**\n * Makes an AnnotatedObservation for medication monitoring.\n * The annotations read out how long it's been since the prior medication\n * dose, and how long it was until the next medication dose was given.\n * @param observation The monitoring observation to annotate\n * @param medicationOrderSet The medication orders containing the doses of the\n * corresponding medication\n * @throws Error if there are two medication orders in MedicationOrderSet\n * that contain the timestamp of the observation\n */\n static forMedicationMonitoring(\n observation: Observation,\n medicationOrderSet: MedicationOrderSet): AnnotatedObservation {\n // Look in the medication order set's administrations and find the ones\n // closest in time to this observation.\n let doseCountBefore: number;\n let doseCountAfter: number;\n let timeSinceLast: Duration;\n let timeBeforeNext: Duration;\n\n const annotations = new Array<[string, string]>();\n // Find the medication order set that coincides in time with this\n // administration (if any).\n let containingMedicationOrder: MedicationOrder;\n for (const order of medicationOrderSet.resourceList) {\n if (Interval\n .fromDateTimes(\n order.firstAdministration.timestamp,\n order.lastAdmininistration.timestamp)\n .contains(observation.timestamp)) {\n if (containingMedicationOrder) {\n throw Error('Two medication orders contain this monitoring point.');\n }\n containingMedicationOrder = order;\n }\n }\n\n if (containingMedicationOrder) {\n // Find the spot in the array of administrations where the monitoring\n // would fall, timewise.\n const sortedAdmins =\n containingMedicationOrder.administrationsForOrder.resourceList.sort(\n (a, b) => a.medAdministration.timestamp.toMillis() -\n b.medAdministration.timestamp.toMillis());\n\n let idx = 0;\n while (idx < sortedAdmins.length &&\n sortedAdmins[idx].medAdministration.timestamp <\n observation.timestamp) {\n idx++;\n }\n\n // It's guaranteed that there's a dose before the monitoring point and a\n // dose after the monitoring point since we check to make sure\n // the observation is between the first and last administrations.\n // Here we look up those dose numbers and the time difference between\n // the doses and the monitoring point.\n const doseBeforeObs = sortedAdmins[idx - 1];\n const doseAfterObs = sortedAdmins[idx];\n\n doseCountBefore = doseBeforeObs.doseInOrder;\n timeSinceLast =\n observation.timestamp.diff(doseBeforeObs.medAdministration.timestamp);\n\n doseCountAfter = doseAfterObs.doseInOrder;\n timeBeforeNext =\n doseAfterObs.medAdministration.timestamp.diff(observation.timestamp);\n\n annotations.push([\n 'Time since dose #' + doseCountBefore, timeSinceLast.toFormat('h:mm')\n ]);\n\n annotations.push([\n 'Time before dose #' + doseCountAfter, timeBeforeNext.toFormat('h:mm')\n ]);\n }\n\n return new AnnotatedObservation(observation, annotations);\n }\n\n /**\n * Makes an AnnotatedObservation for blood pressure, with information about\n * the blood pressure location.\n * @param observation The monitoring observation to annotate\n * @param locationSet The ObservationSet containing Blood Pressure location\n * observations.\n * @throws Error if there are two observations in locationSet\n * that contain the timestamp of the observation\n */\n static forBloodPressure(\n observation: Observation,\n locationSet: ObservationSet): AnnotatedObservation {\n const annotations = new Array<[string, string]>();\n // Find the medication order set that coincides in time with this\n // administration (if any).\n if (locationSet) {\n for (const locationObs of locationSet.resourceList) {\n if (locationObs.observation.timestamp.equals(observation.timestamp)) {\n annotations.push(\n ['Blood Pressure Location', locationObs.observation.result]);\n }\n }\n }\n\n return new AnnotatedObservation(observation, annotations);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\nimport {FhirResourceType} from '../../constants';\nimport {BCHMicrobioCodeGroup} from '../clinicalconcepts/bch-microbio-code';\nimport {ResourceCode} from '../clinicalconcepts/resource-code-group';\nimport {ResultError} from '../result-error';\n\nimport {Observation} from './observation';\nimport {Specimen} from './specimen';\n\n/**\n * FHIR element for DiagnosticReportStatus, from the DSTU2 version of the\n * standard.\n * https://www.hl7.org/fhir/valueset-diagnostic-report-status.html\n */\nexport enum DiagnosticReportStatus {\n Registered = 'Registered',\n Partial = 'Partial',\n Preliminary = 'Preliminary',\n Final = 'Final',\n Amended = 'Amended',\n Corrected = 'Corrected',\n Appended = 'Appended',\n Cancelled = 'Cancelled',\n EnteredInError = 'Enteredinerror',\n Unknown = 'Unknown'\n}\n\nconst statusToEnumMap = new Map([\n ['registered', DiagnosticReportStatus.Registered],\n ['partial', DiagnosticReportStatus.Partial],\n ['preliminary', DiagnosticReportStatus.Preliminary],\n ['final', DiagnosticReportStatus.Final],\n ['amended', DiagnosticReportStatus.Amended],\n ['corrected', DiagnosticReportStatus.Corrected],\n ['appended', DiagnosticReportStatus.Appended],\n ['cancelled', DiagnosticReportStatus.Cancelled],\n ['entered-in-error', DiagnosticReportStatus.EnteredInError],\n ['unknown', DiagnosticReportStatus.Unknown],\n]);\n\n/**\n * FHIR resource for DiagnosticReport, from the DSTU2 version of the standard.\n * https://www.hl7.org/fhir/DSTU2/diagnosticreport.html\n *\n * The parsing for this class is heavily influenced by the custom API BCH\n * built to return DiagnosticReports for microbiology data. In particular, we\n * only parse out specimens and results from the \"contained\" portion of the\n * resource instead of supporting retrieval by reference since the Cerner\n * implementation of the FHIR standard won't allow microbiology retrieval.\n */\nexport class DiagnosticReport {\n readonly id: string;\n\n /** Specimen this report is based on */\n readonly specimen: Specimen;\n\n /** Results in the form of observations */\n readonly results = new Array();\n\n /** Status for this test */\n readonly status: DiagnosticReportStatus;\n\n /** Request ID of the request that obtained this report data */\n readonly requestId: string;\n\n constructor(json: any, requestId: string) {\n this.requestId = requestId;\n\n if (json.id) {\n this.id = json.id;\n }\n\n // Contained resources may be either specimens or observations.\n const contained = json.contained;\n const specimens = [];\n for (const rsc of contained) {\n if (rsc.resourceType === FhirResourceType.Specimen) {\n specimens.push(new Specimen(rsc, this.requestId));\n } else if (rsc.resourceType === FhirResourceType.Observation) {\n try {\n this.results.push(new Observation(rsc, this.requestId));\n } catch (err) {\n // silently ignore observations within diagnostic reports that have\n // errors. Errors may occur because an observation may not have a\n // LOINC code we recognize or may have an inconsistent label.\n // Please see Observation constructor for all error cases.\n console.log(err);\n }\n }\n // Silently ignore all other contained resource types.\n }\n if (specimens.length > 1) {\n throw new ResultError(\n new Set([this.requestId]),\n 'The report cannot have multiple specimens.');\n }\n this.specimen = specimens[0];\n\n if (!json.status) {\n throw new ResultError(\n new Set([this.requestId]),\n 'The report needs a status to be useful.' + json);\n }\n\n this.status = statusToEnumMap.get(json.status);\n }\n\n /**\n * The custom microbiology API provided does not allow for calling for\n * a specific microbio code, so this function parses the entire anticipated\n * JSON repsonse and filters by code.\n * @param json The JSON retrieved from the server.\n * @param codeGroup The CodeGroup of tests we're looking for.\n */\n static parseAndFilterMicrobioData(json: any, codeGroup: BCHMicrobioCodeGroup):\n Array {\n if (!json || !json.entry) {\n return [];\n }\n // We cannot get the request ID from the Microbiology response. Therefore\n // we hardcode the request ID to just be a constant string.\n const requestId = 'Microbiology Request';\n\n const diagnosticReports: DiagnosticReport[] = json.entry.map(\n result => new DiagnosticReport(result.resource, requestId));\n\n const mapToUpdate = new Map();\n // Get all unique codes for all DiagnosticReport results.\n for (const report of diagnosticReports) {\n const codes: ResourceCode[] =\n report.results.map(r => r.codes)\n .reduce((prev: ResourceCode[], curr: ResourceCode[]) => {\n return prev.concat(curr);\n }, []);\n const uniqueCodes: ResourceCode[] = Array.from(new Set(codes));\n for (const code of uniqueCodes) {\n let existing = mapToUpdate.get(code);\n if (!existing) {\n existing = [];\n }\n existing.push(report);\n mapToUpdate.set(code, existing);\n }\n }\n let reports = new Array();\n for (const code of codeGroup.resourceCodes) {\n if (mapToUpdate.has(code)) {\n reports = reports.concat(mapToUpdate.get(code));\n }\n }\n return reports;\n }\n}\n","import {fixUnitAbbreviations} from '../unit_utils';\n\n// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/**\n * This object represents relevant components of dosage information, provided\n * in MedicationOrders and MedicationAdministrations.\n */\nexport class Dosage {\n readonly quantity: number;\n readonly unit: string;\n readonly route: string;\n readonly text: string;\n\n constructor(json: any) {\n if (json.dosage) {\n if (json.dosage.quantity) {\n this.quantity = json.dosage.quantity.value;\n this.unit = fixUnitAbbreviations(json.dosage.quantity.unit);\n }\n if (json.dosage.route) {\n this.route = json.dosage.route.text;\n }\n /*\n * The text for the dosage usually contains information about the rate of\n * administration, however the format across different\n * MedicationAdministrations is not consistent. Ex: \"500 mg IV q6hr\" vs\n * \"250 mg = 1 caps Oral Once\"\n */\n this.text = json.dosage.text;\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\nimport {ResultError} from './../result-error';\n\n/**\n * This object represents basic information about an Encounter: what its\n * reason and type were, when it happened, and its ID.\n */\nexport class Encounter {\n readonly encounterId: string;\n readonly period: Interval;\n readonly requestId: string;\n\n constructor(private json: any, requestId: string) {\n this.encounterId = json.id;\n this.requestId = requestId;\n\n if (!json.period) {\n throw new ResultError(\n new Set([this.requestId]), 'An encounter must have a time period.',\n json);\n }\n\n if (!json.period.start) {\n throw new ResultError(\n new Set([this.requestId]), 'An encounter must have a start date.',\n json);\n }\n const startTime = DateTime.fromISO(json.period.start).toLocal();\n\n let endTime = json.period.end ?\n DateTime.fromISO(json.period.end).toLocal() :\n undefined;\n if (endTime === undefined || (endTime > DateTime.local())) {\n endTime = DateTime.local();\n }\n\n if (endTime < startTime) {\n throw new ResultError(\n new Set([this.requestId]),\n 'The start time comes before the end time.', json);\n }\n if (startTime > DateTime.local()) {\n throw new ResultError(\n new Set([this.requestId]), 'The start time is in the future.', json);\n }\n this.period = Interval.fromDateTimes(startTime, endTime);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime} from 'luxon';\nimport {FhirResourceType} from 'src/constants';\n\nimport {RxNormCode} from '../clinicalconcepts/rx-norm';\nimport {FhirResourceSet, ResultClass, ResultClassWithTimestamp} from '../fhir-resource-set';\nimport {fixUnitAbbreviations} from '../unit_utils';\nimport {ResultError} from './../result-error';\n\nimport {Dosage} from './dosage';\nimport {ContainedMedication} from './medication';\n\n\n/**\n * This object represents a FHIR MedicationAdministration. It does not contain\n * all the information in a standard MedicationAdministration (see\n * https://www.hl7.org/fhir/DSTU2/medicationadministration.html) but instead\n * stores only the information we're interested in seeing.\n */\nexport class MedicationAdministration extends ResultClassWithTimestamp {\n readonly MED_RESOURCE_TYPE = 'Medication';\n readonly rxNormCode: RxNormCode;\n readonly timestamp: DateTime;\n readonly wasNotGiven: boolean;\n readonly dosage: Dosage;\n readonly medicationOrderId: string;\n readonly containedMedications: ContainedMedication[] = [];\n\n /**\n * Makes an MedicationAdministration out of a JSON object that represents a\n * a FHIR MedicationAdministration.\n * https://www.hl7.org/fhir/DSTU2/medicationadministration.html\n * @param json A JSON object that represents a FHIR MedicationAdministration.\n * @param requestId The x-request-id of the request that acquired this\n * medication administration's data.\n */\n constructor(private json: any, requestId: string) {\n super(\n json.medicationReference ? json.medicationReference.display :\n json.medicationCodeableConcept ?\n json.medicationCodeableConcept.text :\n null,\n requestId,\n json.effectiveTimeDateTime ?\n DateTime.fromISO(json.effectiveTimeDateTime).toUTC() :\n json.effectiveTimePeriod ?\n DateTime.fromISO(json.effectiveTimePeriod.start).toUTC() :\n null);\n this.rxNormCode = ResultClass.extractMedicationEncoding(json);\n\n this.dosage = new Dosage(json);\n this.wasNotGiven = json.wasNotGiven;\n this.medicationOrderId = json.prescription && json.prescription.reference ?\n json.prescription.reference.replace(\n FhirResourceType.MedicationOrder + '/', '') :\n null;\n\n if (json.contained && json.contained.length > 0) {\n // We first find the element that lists the \"ingredients\" of this\n // MedicationAdministration with each corresponding dosage and reference\n // id. This element of \"contained\" will have the same id as the overall\n // MedicationAdministration's medicationReference number.\n const referenceId =\n json.medicationReference ? json.medicationReference.reference : null;\n\n const ingredientReferences = new Map();\n if (referenceId) {\n const index = json.contained.findIndex(\n el =>\n (el.resourceType === this.MED_RESOURCE_TYPE && el.product &&\n el.id === referenceId.replace('#', '')));\n const listOfIngredients = json.contained[index];\n if (listOfIngredients && listOfIngredients.product.ingredient) {\n for (const el of listOfIngredients.product.ingredient) {\n if (el.item && el.amount) {\n ingredientReferences.set(el.item.reference.replace('#', ''), el);\n }\n }\n }\n // Remove the element similar to a \"list of ingredients\" from contained.\n if (index > -1) {\n json.contained.splice(index, 1);\n }\n }\n if (ingredientReferences.size > 0 && json.contained.length > 1) {\n // We map the Medications in the list of ingredients to JSON elements\n // containing the RxNorms for each ingredient.\n for (const ing of json.contained) {\n this.containedMedications.push(new ContainedMedication(\n ing, ingredientReferences, this.requestId));\n }\n }\n }\n\n if (!(this.rxNormCode && this.label)) {\n // If a MedicationAdministration has \"Contained\" portions of different\n // ingredients, then there might not be one single RxNorm corresponding to\n // this administration.\n\n // We throw an error if all contained medications do not\n // have an RxNormCode, or if there are no contained medications.\n if (this.containedMedications.length === 0 ||\n (this.containedMedications.length > 0 &&\n this.containedMedications.every(med => (med.code === undefined)))) {\n throw new ResultError(\n new Set([this.requestId]),\n 'JSON must include RxNormCode and a label' +\n ' to be included as a MedicationAdministration.',\n json);\n }\n }\n }\n}\n\n/**\n * A set of MedicalAdministrations that belong together as part of the same\n * series.\n */\nexport class MedicationAdministrationSet extends\n FhirResourceSet {\n readonly maxDose: number;\n readonly minDose: number;\n readonly unit: string;\n readonly rxNormCode: RxNormCode;\n\n /**\n * Constructor for MedicationAdministrationSet.\n * @param medicationAdministrationList The list of MedicationAdministrations\n * belonging together.\n * @throws Error if the administrations have different labels or RxNorms,\n * or if there is not a label, or if the administrations have different\n * units.\n */\n constructor(medicationAdministrationList: AnnotatedAdministration[]) {\n super(medicationAdministrationList);\n\n const requestIdsString = Array.from(this.requestIds).join(', ');\n\n const rxNorms =\n medicationAdministrationList.map(x => x.medAdministration.rxNormCode);\n if (new Set(rxNorms).size > 1) {\n throw new ResultError(\n this.requestIds,\n `Different RxNorms for administrations: ${rxNorms}.`);\n }\n this.rxNormCode = rxNorms[0];\n\n this.minDose = Math.min(...medicationAdministrationList.map(\n x => x.medAdministration.dosage.quantity));\n this.maxDose = Math.max(...medicationAdministrationList.map(\n x => x.medAdministration.dosage.quantity));\n\n const units = new Set(\n medicationAdministrationList.map(x => x.medAdministration.dosage.unit));\n if (units.size > 1) {\n throw new ResultError(\n this.requestIds,\n `Different units in the administration set: ${\n Array.from(units.values())}.`);\n }\n this.unit = fixUnitAbbreviations(Array.from(units.values())[0]);\n }\n}\n\n/**\n * A MedicationAdministration with additional information relating it to\n * the other administrations in the same order.\n */\nexport class AnnotatedAdministration extends ResultClass {\n /** The medication administration to be annotated. */\n readonly medAdministration: MedicationAdministration;\n\n /**\n * The dose number for this administration in this order. The first dose is\n * numbered 1.\n */\n readonly doseInOrder: number;\n\n /**\n * The numbered day for this dose within this order. The first dose will\n * be on day 1. Day 2 starts 24 hours after the first dose administration,\n * day 3 24 hours after that, etc.\n */\n readonly doseDay: number;\n\n /**\n * The annotated dose for the dose prior to this one. Undefined if this is\n * the first dose.\n */\n readonly previousDose: AnnotatedAdministration;\n\n constructor(\n medAdmin: MedicationAdministration, doseInOrder: number, doseDay: number,\n prevDose?: AnnotatedAdministration) {\n super(medAdmin.label, medAdmin.requestId);\n this.medAdministration = medAdmin;\n this.doseInOrder = doseInOrder;\n this.doseDay = doseDay;\n this.previousDose = prevDose;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Disable this check because it's for IE 11 compatibility and we're not worried\n// about that in our testing code.\n/* tslint:disable:object-literal-shorthand*/\n\nimport {MedicationConceptGroup, RxNormCode} from '../clinicalconcepts/rx-norm';\nimport {FhirResourceSet, ResultClass} from '../fhir-resource-set';\nimport {FhirService} from '../fhir.service';\nimport {fixUnitAbbreviations} from '../unit_utils';\nimport {ResultError} from './../result-error';\n\nimport {AnnotatedAdministration, MedicationAdministration, MedicationAdministrationSet} from './medication-administration';\n\n/**\n * FHIR element for MedicationOrderStatus, from the DSTU2 version of the\n * standard.\n * http://hl7.org/fhir/DSTU2/valueset-medication-order-status.html\n */\nexport const MedicationOrderStatus = {\n ACTIVE: 'active',\n ON_HOLD: 'on-hold',\n COMPLETED: 'completed',\n ENTERED_IN_ERROR: 'entered-in-error',\n STOPPED: 'stopped',\n DRAFT: 'draft',\n}\n\n/**\n * This object represents a FHIR MedicationOrder. It does not contain\n * all the information in a standard MedicationOrder (see\n * https://www.hl7.org/fhir/DSTU2/medicationorder.html) but instead\n * stores only the information we're interested in seeing.\n */\nexport class MedicationOrder extends ResultClass {\n readonly rxNormCode: RxNormCode;\n readonly dosageRetrievalError = 'Could not retrieve dosage instructions.';\n firstAdministration: MedicationAdministration;\n lastAdmininistration: MedicationAdministration;\n administrationsForOrder: MedicationAdministrationSet;\n readonly status: string;\n readonly orderId: string;\n\n // By default, we set the instruction message as the retrieval error message,\n // and change it if we find a valid dosage instruction.\n dosageInstruction = this.dosageRetrievalError;\n /**\n * Makes an MedicationOrder out of a list of MedicationAdministrations.\n * https://www.hl7.org/fhir/DSTU2/medicationorder.html\n * @param json The json representing this MedicationOrder.\n * @param requestId The x-request-id of the request that acquired this\n * medication order's data.\n */\n constructor(private json: any, requestId: string) {\n // A MedicationOrder's label is one of the following in order of preference:\n // 1) the medication reference's display anme\n // 2) the medication encoding's text\n // 3) the order's ID\n super(\n json.medicationReference ? json.medicationReference.display :\n json.medicationCodeableConcept ?\n json.medicationCodeableConcept.text :\n json.id,\n requestId);\n\n if (json.dosageInstruction && json.dosageInstruction[0]) {\n if (json.dosageInstruction.length > 1) {\n throw new ResultError(\n new Set([this.requestId]),\n 'JSON must only include one dosage instruction.', json);\n }\n this.dosageInstruction = json.dosageInstruction[0].text;\n }\n this.orderId = json.id;\n this.status = json.status;\n\n this.rxNormCode = ResultClass.extractMedicationEncoding(json);\n\n if (!(this.rxNormCode && this.label)) {\n throw new ResultError(\n new Set([this.requestId]),\n 'JSON must include RxNormCode and a label to be included as a MedicationOrder.',\n json);\n }\n\n // Check this MedicationOrder label against the RxNorm label.\n if (this.label.toLowerCase() !== this.rxNormCode.label.toLowerCase()) {\n throw new ResultError(\n new Set([this.requestId]),\n `The label for this MedicationOrder's RxNorm code doesn't match ` +\n `the label in the data. MedicationOrder label: ${this.label}. ` +\n `RxNorm label: ${this.rxNormCode.label}.`);\n }\n }\n\n /**\n * Sets the MedicationAdministration info for this MedicationOrder.\n * @param fhirService The FhirService used to find the\n * MedicationAdministrations corresponding to this MedicationOrder.\n * @throws Error if the label for the list of administrations does not match\n * the label for this order.\n * @returns This order, after all the promises are resolved.\n */\n setMedicationAdministrations(fhirService: FhirService):\n Promise {\n return fhirService\n .getMedicationAdministrationsWithOrder(this.orderId, this.rxNormCode)\n .then(\n medAdmins => {\n if (!medAdmins) {\n return this;\n }\n medAdmins = medAdmins.sort((a, b) => {\n return a.timestamp.toMillis() - b.timestamp.toMillis();\n });\n this.firstAdministration = medAdmins[0];\n this.lastAdmininistration = medAdmins[medAdmins.length - 1];\n\n const admins = [];\n for (let i = 0; i < medAdmins.length; i++) {\n const admin = medAdmins[i];\n // We want the dose counts and day counts to start with 1 so we\n // add 1 to the day count and the index for the dose.\n const dayCount =\n admin.timestamp.diff(this.firstAdministration.timestamp)\n .as('day') + 1;\n const annotated = new AnnotatedAdministration(\n admin, i + 1 /* dose in order starts at 1 */, dayCount,\n i > 0 ? admins[i - 1] : undefined);\n admins.push(annotated);\n }\n this.administrationsForOrder =\n new MedicationAdministrationSet(admins);\n return this;\n },\n rejection => {\n // Throw an error if the construction of the\n // MedicationAdministration results in an error.\n throw rejection;\n });\n }\n}\n\n/**\n * A set of MedicationOrders that belong together as part of the same\n * series, representing all orders for the medicine in a given time period.\n */\nexport class MedicationOrderSet extends FhirResourceSet {\n /*\n * The RxNormCode for this set of data. All data in this set\n * must have the same RxNormCode.\n */\n readonly rxNormCode: RxNormCode;\n readonly medicationConcept: MedicationConceptGroup;\n\n readonly maxDose: number;\n readonly minDose: number;\n readonly unit: string;\n\n /**\n * Constructor for MedicationOrderSet.\n * @param MedicationOrderList The list of MedicationOrders belonging\n * together. This list is sorted by first MedicationAdministration for\n * each order.\n * @throws Error if the observations have different labels/RxNormCodes, or\n * if there is not a label/RxNormCode.\n */\n constructor(medicationOrderList: MedicationOrder[]) {\n // Sort the list by first administration.\n medicationOrderList = medicationOrderList.sort(function(a, b) {\n return a.firstAdministration.timestamp.toMillis() -\n b.firstAdministration.timestamp.toMillis();\n });\n super(medicationOrderList);\n // Set the RxNormCode and MedicationConceptGroup for this\n // MedicationOrderSet.\n if (medicationOrderList.length > 0) {\n const requestIdsString = Array.from(this.requestIds).join(', ');\n\n const firstRxNorm = medicationOrderList[0].rxNormCode;\n if (!firstRxNorm) {\n throw new ResultError(\n this.requestIds,\n 'The first resource does not have an RxNorm code.');\n }\n\n for (const rs of medicationOrderList) {\n if (rs.rxNormCode !== firstRxNorm) {\n throw new ResultError(\n this.requestIds,\n 'The resource list in this set has mixed RxNorm codes.');\n }\n }\n this.rxNormCode = firstRxNorm;\n this.medicationConcept = this.rxNormCode.displayGrouping;\n\n this.minDose = Math.min(\n ...medicationOrderList.map(x => x.administrationsForOrder.minDose));\n this.maxDose = Math.max(\n ...medicationOrderList.map(x => x.administrationsForOrder.maxDose));\n\n const units =\n new Set(medicationOrderList.map(x => x.administrationsForOrder.unit));\n if (units.size > 1) {\n throw new ResultError(\n this.requestIds,\n `Different units in the order set: ${Array.from(units.values())}`);\n }\n this.unit = fixUnitAbbreviations(Array.from(units.values())[0]);\n }\n }\n}\n/* tslint:enable:object-literal-shorthand*/\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\nimport {RxNormCode} from '../clinicalconcepts/rx-norm';\nimport {ResultClass} from '../fhir-resource-set';\nimport {ResultError} from '../result-error';\n\nimport {Dosage} from './dosage';\n\n/**\n * This object represents relevant components of a medication contained as part\n * of a MedicationAdministration.\n * This is not a FHIR resource, and differs from the defined Medication\n * documentation at http://hl7.org/fhir/dstu2/medication.html.\n */\nexport class ContainedMedication extends ResultClass {\n readonly code: RxNormCode;\n readonly dosage: Dosage;\n readonly id: string;\n constructor(json: any, ingredients: Map, requestId: string) {\n super(json.code ? json.code.text : null, requestId);\n // We want to construct new Medications for jsons containing RxNorm codes.\n if (json.resourceType !== 'Medication') {\n throw new ResultError(\n new Set([this.requestId]), 'Resource must be of type Medication',\n json);\n }\n if (json.code) {\n if (json.code.coding) {\n this.code =\n json.code.coding\n .map(\n // Map the codes to a boolean that is true only if the\n // encoding is an RxNormCode encoding, and the RxNorm code\n // appeas in our RxNormCode list that we care about.\n (coding) => (!coding.system ||\n coding.system.indexOf(\n RxNormCode.CODING_STRING) !== -1) &&\n RxNormCode.fromCodeString(coding.code))\n // Filter out any codes that are not RxNorm codes.\n .filter((code) => !!code)[0];\n }\n }\n if (!this.code) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Medication must have RxNorm code to be useful', json);\n }\n this.id = json.id;\n const reference = ingredients.get(this.id);\n if (!reference) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Medication info must have been contained in ingredient list.', json);\n }\n if (this.id) {\n // The dosage format is different for contained\n // portions of Medications.\n const dosage = {\n dosage: {\n quantity: {\n value: reference.amount.numerator ?\n reference.amount.numerator.value :\n null,\n unit: reference.amount.numerator ? reference.amount.numerator.unit :\n null\n },\n }\n };\n this.dosage = new Dosage(dosage);\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/** This is the URL for the coding system for observation interpretations. */\nexport const OBSERVATION_INTERPRETATION_VALUESET_URL =\n 'http://hl7.org/fhir/ValueSet/observation-interpretation';\n\n/**\n * These are codes corresponding to ObservationInterpretations used in\n * MicrobioGraph.\n */\nexport const CHECK_RESULT_CODE = 'CHECKRESULT';\nexport const NEGFLORA_CODE = 'NEGORFLORA';\nexport const NEG_CODE = 'NEG';\nexport const NORMAL = 'N';\n\n/**\n * Represents the possible interpretations for observations. Each interpretation\n * has a code (usually 1-3 characters) plus a text description for display.\n * This class also keeps track of a map of codes to display text.\n */\nexport class ObservationInterpretation {\n static codeToObject = new Map();\n\n readonly code: string;\n readonly display: string;\n\n constructor(code: string, display: string) {\n this.code = code;\n this.display = display;\n ObservationInterpretation.codeToObject.set(code, this);\n }\n}\n\n/**\n * These are the FHIR standard value set values.\n * http://hl7.org/fhir/valueset-observation-interpretation.html\n */\nconst STANDARD_FHIR_INTERPRETATIONS = [\n new ObservationInterpretation('<', 'Off scale low'),\n new ObservationInterpretation('>', 'Off scale high'),\n new ObservationInterpretation('A', 'Abnormal'),\n new ObservationInterpretation('A', 'Critically abnormal'),\n new ObservationInterpretation('AC', 'Anti-complementary substances present'),\n new ObservationInterpretation('B', 'Better'),\n new ObservationInterpretation('D', 'Significant change down'),\n new ObservationInterpretation('DET', 'Detected'),\n new ObservationInterpretation('H', 'High'),\n new ObservationInterpretation('HH', 'Critically high'),\n new ObservationInterpretation('HM', 'Hold for Medical Review'),\n new ObservationInterpretation('HU', 'Very high'),\n new ObservationInterpretation('I', 'Intermediate'),\n new ObservationInterpretation('IE', 'Insufficient evidence'),\n new ObservationInterpretation('IND', 'Indeterminate'),\n new ObservationInterpretation('L', 'Low'),\n new ObservationInterpretation('LL', 'Critically low'),\n new ObservationInterpretation('LU', 'Very low'),\n new ObservationInterpretation(\n 'MS',\n 'Moderately susceptible. Indicates for microbiology susceptibilities only.'),\n new ObservationInterpretation(NORMAL, 'Normal'),\n new ObservationInterpretation('ND', 'Not Detected'),\n new ObservationInterpretation(NEG_CODE, 'Negative'),\n new ObservationInterpretation('NR', 'Non-reactive'),\n new ObservationInterpretation('NS', 'Non-susceptible'),\n new ObservationInterpretation(\n 'null', 'No range defined, or normal ranges don\\'t apply'),\n new ObservationInterpretation(\n 'OBX', 'Interpretation qualifiers in separate OBX segments'),\n new ObservationInterpretation('POS', 'Positive'),\n new ObservationInterpretation('QCF', 'Quality Control Failure'),\n new ObservationInterpretation('R', 'Resistant'),\n new ObservationInterpretation('RR', 'Reactive'),\n new ObservationInterpretation('S', 'Susceptible'),\n new ObservationInterpretation('SDD', 'Susceptible-dose dependent'),\n new ObservationInterpretation('SYN-R', 'Synergy - resistant'),\n new ObservationInterpretation('SYN-S', 'Synergy - susceptible'),\n new ObservationInterpretation('TOX', 'Cytotoxic substance present'),\n new ObservationInterpretation('U', 'Significant change up'),\n new ObservationInterpretation(\n 'VS',\n 'Very susceptible. Indicates for microbiology susceptibilities only.'),\n new ObservationInterpretation('W', 'Worse'),\n new ObservationInterpretation('WR', 'Weakly reactive')\n];\n\n/**\n * This valueset is extensible, so here are some that BCH extends it with\n * for its microbiology results.\n */\nconst BCH_CUSTOM_INTERPRETATIONS = [\n new ObservationInterpretation(CHECK_RESULT_CODE, 'Check result'),\n new ObservationInterpretation(NEGFLORA_CODE, 'Negative or Flora')\n];\n\nconst ALL_INTERPRETATIONS =\n [].concat(BCH_CUSTOM_INTERPRETATIONS, STANDARD_FHIR_INTERPRETATIONS);\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime} from 'luxon';\n\nimport {FhirResourceSet} from '../fhir-resource-set';\nimport {fixUnitAbbreviations} from '../unit_utils';\n\nimport {AnnotatedObservation} from './annotated-observation';\n\n/**\n * A set of observations that belong together as part of the same series.\n */\nexport class ObservationSet extends FhirResourceSet {\n /**\n * The normal ranges for this set of observations. It maps a timestamp of each\n * Observation with a normal range to the corresponding normal range.\n */\n normalRanges = new Map();\n\n /**\n * The units for this set of observations. Left unset if the normal\n * range is different across the observations.\n */\n readonly unit: string;\n\n /**\n * Whether or not any Observations belonging to this ObservationSet contain\n * qualitative results rather than numerical values.\n */\n readonly anyQualitative: boolean = false;\n\n /**\n * Constructor for ObservationSet.\n * @param observationList The list of observations belonging together.\n * @throws Error if the observations have different labels, as this indicates\n * that they are data points from different series, or if there is not\n * a label.\n */\n constructor(observationList: AnnotatedObservation[]) {\n super(observationList);\n\n let firstUnit;\n if (observationList.length > 0) {\n firstUnit = observationList[0].observation.unit;\n }\n // Ensure that the labels of the data are all the same.\n let differentUnits = false;\n\n for (const obs of observationList) {\n // Some observations may not have a normal range.\n if (obs.observation.normalRange) {\n this.normalRanges.set(\n obs.observation.timestamp, obs.observation.normalRange);\n }\n // Some observations may not have a normal range.\n if (obs.observation.unit && obs.observation.unit !== firstUnit) {\n differentUnits = true;\n }\n }\n if (!differentUnits && firstUnit) {\n this.unit = fixUnitAbbreviations(firstUnit);\n }\n\n this.anyQualitative = observationList.some(\n obs => (obs.observation.result !== null && !obs.observation.value));\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime} from 'luxon';\n\nimport {BCHMicrobioCode} from '../clinicalconcepts/bch-microbio-code';\nimport {LOINCCode} from '../clinicalconcepts/loinc-code';\nimport {ResourceCode} from '../clinicalconcepts/resource-code-group';\nimport {ResultClass} from '../fhir-resource-set';\nimport {fixUnitAbbreviations} from '../unit_utils';\nimport {ResultError} from './../result-error';\n\nimport {OBSERVATION_INTERPRETATION_VALUESET_URL, ObservationInterpretation} from './observation-interpretation-valueset';\n\n\n/**\n * These are the quantity attributes provided by FHIR. See\n * https://www.hl7.org/fhir/datatypes.html#quantity\n */\ninterface Quantity {\n value: number;\n comparator: string;\n unit: string;\n system: string;\n code: string;\n}\n\n/**\n * FHIR element for ObservationStatus, from the DSTU2 version of the\n * standard.\n * http://hl7.org/fhir/DSTU2/valueset-observation-status.html\n */\nexport enum ObservationStatus {\n Registered = 'Registered',\n Preliminary = 'Preliminary',\n Final = 'Final',\n Amended = 'Amended',\n Cancelled = 'Cancelled',\n EnteredInError = 'Enteredinerror',\n Unknown = 'Unknown'\n}\n\nconst statusToEnumMap = new Map([\n ['registered', ObservationStatus.Registered],\n ['preliminary', ObservationStatus.Preliminary],\n ['final', ObservationStatus.Final],\n ['amended', ObservationStatus.Amended],\n ['cancelled', ObservationStatus.Cancelled],\n ['entered-in-error', ObservationStatus.EnteredInError],\n ['unknown', ObservationStatus.Unknown],\n]);\n\n/**\n * This object represents a FHIR Observation. It does not contain all the\n * information in a standard Observation\n * (see https://www.hl7.org/fhir/observation.html#resource) but instead stores\n * only the information we're interested in seeing.\n *\n * In general, in terms of the MedTimeLine app, we represent an Observation\n * as a point on a line graph for a lab or a vital sign. Observations also hold\n * information about microbiology report results that show up in the\n * microbiology graph tooltips.\n */\nexport class Observation extends ResultClass {\n readonly codes: ResourceCode[] = [];\n timestamp: DateTime;\n readonly value: Quantity;\n // Populated if the Observation contains a qualitative result, such\n // as \"Yellow\", rather than a numerical value.\n readonly result: string;\n readonly normalRange: [number, number];\n readonly unit: string;\n readonly innerComponents: Observation[] = [];\n // The display string associated with the code for this Observation.\n readonly display: string;\n readonly interpretation: ObservationInterpretation;\n readonly status: ObservationStatus;\n\n // The number of decimal places stored in the value.\n readonly precision: number;\n\n /**\n * Makes an Observation out of a JSON object that represents a\n * a FHIR observation.\n * @param json A JSON object that represents a FHIR observation.\n * @param requestId The x-request-id of the request that acquired this\n * observation's data.\n */\n constructor(private json: any, requestId: string) {\n super(Observation.getLabel(json), requestId);\n\n this.timestamp = json.effectiveDateTime ?\n DateTime.fromISO(json.effectiveDateTime).toUTC() :\n json.issued ? DateTime.fromISO(json.issued).toUTC() : null;\n if (json.code) {\n if (json.code.coding) {\n if (json.code.coding[0].system === BCHMicrobioCode.CODING_STRING) {\n this.codes =\n json.code.coding\n .map((coding) => BCHMicrobioCode.fromCodeString(coding.code))\n // Filter out any codes that are not in our mapping.\n .filter((code) => !!code);\n this.display = json.code.coding[0].display;\n } else {\n this.codes =\n json.code.coding\n .map(\n // Map the codes to a boolean that is true only if the\n // encoding is a LOINC encoding, and the LOINC code appeas\n // in our LOINCCode list that we care about.\n (coding) => (!coding.system ||\n coding.system.indexOf(\n LOINCCode.CODING_STRING) !== -1) &&\n LOINCCode.fromCodeString(coding.code))\n // Filter out any codes that are not LOINC codes.\n .filter((code) => !!code);\n }\n }\n }\n\n if (json.interpretation) {\n if (json.interpretation.coding) {\n const coding = json.interpretation.coding[0];\n if (coding.system === OBSERVATION_INTERPRETATION_VALUESET_URL) {\n if (ObservationInterpretation.codeToObject.has(coding.code)) {\n this.interpretation =\n ObservationInterpretation.codeToObject.get(coding.code);\n } else {\n throw new ResultError(\n new Set([this.requestId]), 'Unsupported interpretation code.',\n coding);\n }\n }\n } else if (json.interpretation.text) {\n // BCH uses a non-standard coding system so we make interpretations on\n // the fly.\n this.interpretation = new ObservationInterpretation(\n json.interpretation.text, json.interpretation.text);\n }\n }\n\n if (json.component) {\n json.component.forEach(element => {\n const innerObs = new Observation(element, this.requestId);\n if (!innerObs.timestamp) {\n innerObs.timestamp = this.timestamp;\n }\n this.innerComponents.push(innerObs);\n });\n }\n\n if (!this.codes || this.codes.length === 0) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Observations have to have a LOINC code to be useful. ', json);\n }\n\n if (!this.label) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Observations have to have a label to be useful.', json);\n }\n\n // Check the observation label against the LOINC code label.\n if (this.label.toLowerCase() !== this.codes[0].label.toLowerCase()) {\n throw new ResultError(\n new Set([this.requestId]),\n `The label for this observation's LOINC code doesn't match ` +\n `the label in the data. Observation label: ${this.label}. ` +\n `LOINC label: ${this.codes[0].label}. `,\n json);\n }\n\n\n this.value = json.valueQuantity ? json.valueQuantity : null;\n if (this.value) {\n this.unit = fixUnitAbbreviations(this.value.unit);\n }\n\n // We must calculate precision before the value is stored as a number,\n // where precision is lost. If the value stored in the json has\n // a precision of 0 and is less than 1, then we change the precision to\n // 1 to display decimals and better UI.\n\n if (json.valueQuantity && json.valueQuantity.value) {\n const values = json.valueQuantity.value.toString().split('.');\n this.precision = values.length > 1 ? values[1].length : 0;\n if (values[0] === '0' && this.precision === 0) {\n this.precision = 1;\n }\n } else {\n // If the values are not present and are instead displayed as a value\n // of 0, the precision is set to 1 to prevent duplicated display of values\n this.precision = 1;\n }\n\n this.result =\n json.valueCodeableConcept ? json.valueCodeableConcept.text : null;\n if (this.value === null && this.result === null && !this.interpretation &&\n (this.innerComponents && this.innerComponents.length === 0)) {\n throw new ResultError(\n new Set([this.requestId]),\n 'An Observation must have a value, result, inner components, ' +\n 'or an interpretation to be useful.',\n json);\n }\n\n // The FHIR standard says that if there's only one range then it should be\n // what is \"normal\" for that measure. Otherwise they should be labeled.\n // We are going to err on the side of safety and not include a normal\n // range unless there's just the one, and it includes a high and low\n // field. https://www.hl7.org/fhir/DSTU2/observation.html#4.20.4.4\n if (json.referenceRange && json.referenceRange.length === 1) {\n if (json.referenceRange[0].low && json.referenceRange[0].high) {\n this.normalRange = [\n json.referenceRange[0].low.value, json.referenceRange[0].high.value\n ];\n }\n }\n\n this.status = statusToEnumMap.get(json.status);\n }\n\n private static getLabel(json: any) {\n let label;\n if (json.code) {\n label = json.code.text;\n if (json.code.coding) {\n if (json.code.coding[0].system === BCHMicrobioCode.CODING_STRING) {\n label = json.code.coding[0].display;\n }\n }\n }\n return label;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\nimport {ResultError} from '../result-error';\n/**\n * FHIR resource for a Specimen, from the DSTU2 standard.\n * https://www.hl7.org/fhir/DSTU2/specimen.html\n */\nexport class Specimen {\n /** If this is a contained resource, then it will have an ID string. */\n readonly id: string;\n\n /** Kind of material that forms the specimen */\n readonly type: string;\n\n /** Where the specimen was collected */\n readonly bodySite: string;\n\n /**\n * When the specimen was collected. The specimen will have one or the other\n * of these defined, but not both.\n */\n readonly collectedDateTime: DateTime;\n readonly collectedPeriod: Interval;\n\n readonly requestId: string;\n\n constructor(json: any, requestId: string) {\n this.requestId = requestId;\n\n if (json.id) {\n this.id = json.id;\n }\n\n if (!json.type) {\n throw new ResultError(\n new Set([this.requestId]),\n 'A specimen must have a type to be useful.', json);\n }\n\n this.type = json.type.text;\n\n if (!json.collection) {\n throw new ResultError(\n new Set([this.requestId]),\n 'A specimen must have collection information to be useful.', json);\n }\n if (json.collection.collectedPeriod && json.collection.collectedDateTime) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Only collectedPeriod or collectionDateTime should be defined.' +\n json);\n }\n\n if (json.collection.collectedPeriod) {\n const collectedPeriod = json.collection.collectedPeriod;\n // If only the start time is present, put it into collectedDateTime.\n if (collectedPeriod.start && !collectedPeriod.end) {\n this.collectedDateTime = DateTime.fromISO(collectedPeriod.start);\n } else {\n this.collectedPeriod = Interval.fromDateTimes(\n DateTime.fromISO(collectedPeriod.start),\n DateTime.fromISO(collectedPeriod.end));\n }\n }\n\n if (json.collection.collectedDateTime) {\n this.collectedDateTime =\n DateTime.fromISO(json.collection.collectedDateTime);\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';\nimport {Inject, Injectable} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {DateTime, Interval} from 'luxon';\n\nimport {APP_TIMESPAN, EARLIEST_ENCOUNTER_START_DATE, FhirResourceType} from '../constants';\n\nimport {BCHMicrobioCodeGroup} from './clinicalconcepts/bch-microbio-code';\nimport {LOINCCode} from './clinicalconcepts/loinc-code';\nimport {documentReferenceLoinc} from './clinicalconcepts/resource-code-manager';\nimport {RxNormCode} from './clinicalconcepts/rx-norm';\nimport {DebuggerService} from './debugger.service';\nimport {DiagnosticReport} from './fhir-data-classes/diagnostic-report';\nimport {Encounter} from './fhir-data-classes/encounter';\nimport {MedicationAdministration} from './fhir-data-classes/medication-administration';\nimport {MedicationOrder} from './fhir-data-classes/medication-order';\nimport {Observation, ObservationStatus} from './fhir-data-classes/observation';\nimport {ResultClass} from './fhir-resource-set';\nimport {FhirService} from './fhir.service';\nimport * as FhirConfig from './fhir_config';\nimport {SMART_ON_FHIR_CLIENT} from './smart-on-fhir-client';\n\nconst GREATER_OR_EQUAL = 'ge';\nconst LESS_OR_EQUAL = 'le';\n\n// The Cerner implementation has a maximum result return of 100 for\n// observations.\nconst CERNER_MAX_OBS_RESULTS_RETURNED = 100;\n\n@Injectable()\nexport class FhirHttpService extends FhirService {\n readonly smartApiPromise: Promise;\n constructor(\n private debugService: DebuggerService,\n @Inject(SMART_ON_FHIR_CLIENT) smartOnFhirClient: any,\n private sanitizer: DomSanitizer, private http: HttpClient) {\n super();\n // Create a promise which resolves to the smart API when the smart API is\n // ready. This allows clients of this service to call service methods\n // which depend on the API, regardless of whether the API is ready or not.\n this.smartApiPromise = new Promise(\n (resolve, reject) => smartOnFhirClient.oauth2.ready(\n smart => resolve(smart), err => reject(err)));\n }\n\n /**\n * Gets the next page of search results from the smart API. This function\n * assumes that the same smartApi was used to call the original search.\n *\n * @param smartApi The resolved smartOnFhirClient\n * @param response The response from the previous page of search results\n * @param results The list of all formatted results processed in previous page\n * responses\n * @param createFunction A function to create a result object from the\n * response\n */\n getNextSearchResultsPage(\n smartApi, response, results,\n createFunction: (json: any, requestId: string) => T): Promise {\n const requestId = response.headers('x-request-id');\n const responseData = response.data.entry || [];\n\n results = results.concat(\n responseData.map(result => createFunction(result.resource, requestId)));\n\n // if there are anymore pages, get the next set of results.\n if (response.data.link.some((link) => link.relation === 'next')) {\n return smartApi.patient.api.nextPage({bundle: response.data})\n .then(nextResponse => {\n return this.getNextSearchResultsPage(\n smartApi, nextResponse, results, createFunction);\n });\n }\n return Promise.resolve(results);\n }\n\n /**\n * Gets all pages of search results for the given query params. Formats\n * the results using the given createFunction.\n *\n * @param smartApi The resolved smartOnFhirClient\n * @param queryParams the params to pass to the search function\n * @param createFunction A function to create result objects from\n * the response data.\n */\n fetchAll(\n smartApi, queryParams,\n createFunction: ((json: any, requestId: string) => T)): Promise {\n const results = [];\n return smartApi.patient.api.search(queryParams)\n .then(\n response => {\n return this\n .getNextSearchResultsPage(\n smartApi, response, results, createFunction)\n .then(results => {\n return results;\n });\n },\n rejection => {\n this.debugService.logError(rejection);\n throw rejection;\n });\n }\n\n private getObservationsSearchParams(code: LOINCCode, dateRange: Interval) {\n // Cerner says that asking for a limited count of resources can slow down\n // queries, so we don't restrict a count limit here.\n // https://groups.google.com/d/msg/cerner-fhir-developers/LMTgGypmLDg/7f6hDoe2BgAJ\n return {\n type: FhirResourceType.Observation,\n query: {\n code: LOINCCode.CODING_STRING + '|' + code.codeString,\n date: {\n $and: [\n GREATER_OR_EQUAL + dateRange.start.toISODate(),\n LESS_OR_EQUAL + dateRange.end.toISODate()\n ]\n },\n }\n };\n }\n\n /**\n * Gets observations from a specified date range with a specific LOINC code.\n * @param code The LOINC code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n */\n getObservationsWithCode(code: LOINCCode, dateRange: Interval):\n Promise {\n const queryParams = this.getObservationsSearchParams(code, dateRange);\n return this.smartApiPromise.then(\n smartApi =>\n this.fetchAll(\n smartApi, queryParams,\n (json, requestId) => new Observation(json, requestId))\n .then(\n (results: Observation[]) => results.filter(\n (result: Observation) => result.status !==\n ObservationStatus.EnteredInError)));\n }\n\n /**\n * Checks if there are any observations with the given LOINC Code within the\n * given date range.\n *\n * Note: Only fetches single page of results from FHIR server to enhance\n * performance.\n *\n * @param code LOINC code to check if there are any observations for\n * @param dateRange the time interval the observations should fall between\n */\n observationsPresentWithCode(code: LOINCCode, dateRange: Interval):\n Promise {\n const queryParams = this.getObservationsSearchParams(code, dateRange);\n return this.smartApiPromise.then(\n smartApi => smartApi.patient.api.search(queryParams)\n .then(response => !!response.data.entry));\n }\n\n /**\n * Formats query parameters for searching for Medication Administrations.\n * @param dateRange Date range to search within\n */\n private getMedicationAdministrationSearchParams(dateRange: Interval) {\n return {\n type: FhirResourceType.MedicationAdministration,\n query: {\n effectivetime: {\n $and: [\n GREATER_OR_EQUAL + dateRange.start.toISODate(),\n LESS_OR_EQUAL + dateRange.end.toISODate()\n ]\n }\n }\n };\n }\n\n /**\n * Gets medication data from a specified date range with a specific Rx code\n * @param code The RxNormCode codes for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount If provided, the maximum number of observations to\n * query for.\n */\n getMedicationAdministrationsWithCode(\n code: RxNormCode, dateRange: Interval,\n limitCount?: number): Promise {\n const queryParams = this.getMedicationAdministrationSearchParams(dateRange);\n\n if (limitCount) {\n queryParams.query['_count'] = limitCount;\n }\n\n return this.smartApiPromise.then(\n smartApi =>\n this.fetchAll(\n smartApi, queryParams,\n (json, requestId) => {\n if (ResultClass.extractMedicationEncoding(json) ===\n code) {\n return new MedicationAdministration(json, requestId);\n }\n })\n .then(\n (results: MedicationAdministration[]) =>\n results.filter((result) => !!result)));\n }\n\n /**\n * Determines whether a medication with the given RxNormCode exists.\n *\n * Checks a single response page and only calls the next page if no\n * medications with the given code exist. Cerner's implementation of FHIR\n * does not support searching by RxNormCode, so we need to get all of the\n * medications and filter the response.\n *\n * @param smartApi The resolved smartOnFhirClient which called the original\n * \"search\"\n * @param response The response of the previous page\n * @param code The RxNormCode to search for\n */\n private checkMedicationsPresentNextPage(smartApi, response, code: RxNormCode):\n Promise {\n const results = response.data.entry || [];\n const resultsWithCode = results.filter(\n result =>\n code === ResultClass.extractMedicationEncoding(result.resource));\n\n if (resultsWithCode.length > 0) {\n return Promise.resolve(true);\n } else {\n if (response.data.link.some((link) => link.relation === 'next')) {\n return smartApi.patient.api.nextPage({bundle: response.data})\n .then(nextResponse => {\n return this.checkMedicationsPresentNextPage(\n smartApi, nextResponse, code);\n });\n } else {\n return Promise.resolve(false);\n }\n }\n }\n\n /**\n * Determines whether their is a medication present with the given code\n * during the given date range\n * @param code The RxNormCode to get medications for\n * @param dateRange The date range to get medications for\n */\n medicationsPresentWithCode(code: RxNormCode, dateRange: Interval):\n Promise {\n const queryParams = this.getMedicationAdministrationSearchParams(dateRange);\n return this.smartApiPromise.then(smartApi => {\n return smartApi.patient.api.search(queryParams)\n .then(\n response => this.checkMedicationsPresentNextPage(\n smartApi, response, code));\n });\n }\n\n /**\n * Gets order for specified external id.\n * @param id The id to pull the order from.\n */\n getMedicationOrderWithId(id: string): Promise {\n return this.smartApiPromise.then(\n smartApi =>\n smartApi.patient.api\n .read({type: FhirResourceType.MedicationOrder, 'id': id})\n .then(\n (result: any) => {\n const requestId = result.headers('x-request-id');\n return new MedicationOrder(result.data, requestId);\n },\n // Do not return any MedicationOrders for\n // this code if one of the MedicationOrder\n // constructions throws an error.\n rejection => {\n this.debugService.logError(rejection);\n throw rejection;\n }));\n }\n\n /**\n * Gets administrations for specified order id.\n * @param id The id to pull the order from.\n */\n getMedicationAdministrationsWithOrder(id: string, code: RxNormCode):\n Promise {\n const queryParams = {\n type: FhirResourceType.MedicationAdministration,\n };\n return this.smartApiPromise.then(\n smartApi =>\n this.fetchAll(\n smartApi, queryParams,\n (json, requestId) => {\n if (ResultClass.extractMedicationEncoding(json) ===\n code) {\n return new MedicationAdministration(json, requestId);\n }\n })\n .then(\n (results: MedicationAdministration[]) =>\n results.filter((result) => !!result)\n .filter(\n (result: MedicationAdministration) =>\n result.medicationOrderId === id)));\n }\n\n /**\n * Gets the encounters for the patient for any encounter that falls in the\n * given date range.\n * @param dateRange Return all encounters that covered any time in this\n * date range.\n */\n getEncountersForPatient(dateRange: Interval): Promise {\n const queryParams = {\n type: FhirResourceType.Encounter,\n };\n\n if (!dateRange) {\n dateRange = APP_TIMESPAN;\n }\n // The Cerner implementation of the Encounter search does not offer any\n // filtering by date at this point, so we grab all the encounters\n // then filter them down to those which intersect with the date range\n // we query, and those that have a start date no earlier than a year prior\n // to now.\n return this.smartApiPromise.then(\n smartApi =>\n this.fetchAll(\n smartApi, queryParams,\n (json, requestId) => new Encounter(json, requestId))\n .then(\n (results: Encounter[]) =>\n results\n .filter(\n (result: Encounter) =>\n dateRange.intersection(result.period) !==\n null)\n .filter(\n (result: Encounter) => result.period.start >=\n EARLIEST_ENCOUNTER_START_DATE)));\n }\n\n /**\n * Saves the current image of the graphs rendered as a DocumentReference\n * (static save).\n * @param html The inner HTML to keep in the Document.\n * @param date The date the note was written on.\n */\n saveStaticNote(image: HTMLCanvasElement, date: string): Promise {\n return this.smartApiPromise.then(smartApi => {\n const postBody = {\n resourceType: FhirResourceType.DocumentReference,\n subject: {\n reference: [FhirResourceType.Patient, smartApi.patient.id].join('/')\n },\n type: {\n coding: [{\n system: LOINCCode.CODING_STRING, // must be loinc\n code: documentReferenceLoinc.codeString, // Summary Note\n }],\n },\n indexed: DateTime.utc().toISO(),\n status:\n 'current', // Required; only supported option is 'current'\n // https://fhir.cerner.com/millennium/dstu2/infrastructure/document-reference/#body-fields\n content: [{\n attachment: {\n contentType: 'application/xhtml+xml;charset=utf-8',\n data: btoa('')\n }\n }],\n context: {\n encounter: {\n reference: [\n FhirResourceType.Encounter, smartApi.tokenResponse.encounter\n ].join('/')\n }\n }\n };\n return smartApi.patient.api.create({resource: postBody})\n .then(\n resolve => {\n return true;\n },\n reject => {\n return false;\n });\n });\n }\n\n /**\n * Gets the DiagnosticReports for the patient for any report that falls in\n * the given date range.\n * @param codeGroup The CodeGroup to retrieve DiagnosticReports for.\n * @param dateRange Return all DiagnosticReports that covered any time in this\n * date range.\n */\n getDiagnosticReports(codeGroup: BCHMicrobioCodeGroup, dateRange: Interval):\n Promise {\n if (!FhirConfig.microbiology) {\n console.warn(\n 'No microbiology parameters available in the configuration.');\n return Promise.resolve([]);\n }\n return this.smartApiPromise.then(\n smartApi => {\n // YYYY-MM-DD format for dates\n let callParams = new HttpParams();\n callParams = callParams.append('patient', smartApi.patient.id);\n callParams = callParams.append('category', 'microbiology'),\n callParams = callParams.append(\n 'item-date', 'ge' + dateRange.start.toFormat('yyyy-MM-dd'));\n callParams = callParams.append(\n 'item-date', 'le' + dateRange.end.toFormat('yyyy-MM-dd'));\n callParams = callParams.append('_format', 'json');\n\n const authString = btoa(\n FhirConfig.microbiology.username + ':' +\n FhirConfig.microbiology.password);\n const httpHeaders = new HttpHeaders({\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'Authorization': 'Basic ' + authString,\n });\n\n return this.http\n .get(\n [\n FhirConfig.microbiology.url,\n FhirResourceType.DiagnosticReport\n ].join('/'),\n {headers: httpHeaders, params: callParams})\n .toPromise()\n .then((res: any) => {\n return DiagnosticReport.parseAndFilterMicrobioData(\n res, codeGroup);\n });\n },\n rejection => {\n this.debugService.logError(rejection);\n throw rejection;\n });\n }\n}\n","module.exports = \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2ZoaXItbGF1bmNoL2ZoaXItbGF1bmNoLmNvbXBvbmVudC5jc3MifQ== */\"","module.exports = \"Launching authentication...\\n
\\n Authentication Information
\\n Base URI: {{this.baseURL}}
\\n Redirect URI : {{this.redirectURL}}
\\n Scopes: {{this.scope}};
\\n URL parameters: {{this.parameters}}
\\n \\n
\\nError: This app is not configured for this EHR.\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport 'fhirclient';\n\nimport {Component, OnInit} from '@angular/core';\nimport {ActivatedRoute} from '@angular/router';\nimport {Router} from '@angular/router';\n\nimport {environment} from '../../environments/environment';\n\nimport * as FhirConfig from './../fhir_config';\n\n/* Type definition for SMART on FHIR client (from assets/fhir-client.min.js) */\ndeclare var FHIR: any;\n\n@Component({\n selector: 'app-fhir-launch',\n templateUrl: './fhir-launch.component.html',\n styleUrls: ['./fhir-launch.component.css']\n})\nexport class FhirLaunchComponent implements OnInit {\n error = false;\n\n scope: string = [\n 'launch', 'patient/Observation.read', 'patient/Patient.read',\n 'patient/MedicationOrder.read', 'patient/MedicationAdministration.read',\n 'patient/DocumentReference.read', 'patient/DocumentReference.write',\n 'patient/Encounter.read'\n ].join(' ');\n\n // We hold these variables in-class for authentication debugging.\n clientId: string;\n baseURL: string;\n redirectURL: string;\n useDebugger: boolean;\n parameters = new Array();\n\n constructor(private router: Router, private route: ActivatedRoute) {}\n\n ngOnInit() {\n if (environment.useMockServer) {\n this.router.navigate(['setup']);\n } else {\n this.useDebugger = environment.useDebugger;\n\n this.route.queryParams.subscribe(params => {\n const state = params['state'];\n const code = params['code'];\n if (state && code) {\n // Navigate to the setup page, passing the code & state parameters\n // along with the URL.\n this.router.navigateByUrl('/setup?code=' + code + '&state=' + state);\n } else {\n if (this.useDebugger) {\n this.clientId = FhirConfig.credentials.client_id;\n this.baseURL = FhirConfig.url.baseURL;\n this.redirectURL = FhirConfig.url.redirectURL;\n this.route.queryParams.subscribe(pms => {\n this.parameters.push(JSON.stringify(pms));\n });\n return;\n }\n\n this.beginAuthenticationFlow();\n }\n });\n }\n }\n\n beginAuthenticationFlow() {\n const clientId = FhirConfig.credentials.client_id;\n if (!clientId) {\n this.error = true;\n } else {\n FHIR.oauth2.authorize({\n 'client_id': clientId,\n 'scope': this.scope,\n 'redirect_uri': FhirConfig.url.redirectURL\n });\n }\n }\n}\n","// Copyright 2019 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\nimport {DateTime} from 'luxon';\n\nimport {RXNORM_CODES, RxNormCode} from './clinicalconcepts/rx-norm';\nimport {ResultError} from './result-error';\n\n// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\nexport class TimestampedObject {\n constructor(readonly timestamp: DateTime) {}\n}\n\nexport class ResultClassWithTimestamp extends TimestampedObject {\n constructor(\n readonly label: string, readonly requestId: string,\n readonly timestamp: DateTime) {\n super(timestamp);\n }\n}\n\n/**\n * A class that has label and requestId attributes.\n *\n * TODO: Figure out how to combine with ResultClassWithTimestamp.\n */\nexport class ResultClass {\n constructor(readonly label: string, readonly requestId: string) {}\n\n /**\n * Parses the passed-in JSON and gets out a RxNormCode.\n *\n * This function prefers to directly get the RxNorm code from the resource's\n * encoding. If it can't get that, it will get the prescription's label,\n * then try to map it back to a RxNorm code. If it can't find a suitable\n * RxNorm code, it will pass back an undefined object.\n */\n static extractMedicationEncoding(json: any): RxNormCode {\n let rxNormCode: RxNormCode;\n if (json.medicationCodeableConcept) {\n if (json.medicationCodeableConcept.coding) {\n rxNormCode =\n (json.medicationCodeableConcept.coding\n .map(\n // Map the codes to a boolean that is true only if the\n // encoding is an RxNorm encoding, and the RxNorm code\n // appears in our RxNormCode list that we care about.\n (coding) => (!coding.system ||\n coding.system.indexOf(\n RxNormCode.CODING_STRING) !== -1) &&\n RxNormCode.fromCodeString(coding.code))\n // Filter out any codes that are not RxNorm codes.\n .filter((code) => !!code))[0];\n } else if (json.medicationCodeableConcept.text) {\n // MedicationAdministrations do not come out of the BCH system with a\n // RxNorm code on at this point, so if we don't get a RxNorm code,\n // as a stopgap we reverse lookup based on the string name.\n const rxNormString = json.medicationCodeableConcept.text;\n const codesWithName = RXNORM_CODES.filter(\n x => x.label.toLowerCase() === rxNormString.toLowerCase());\n rxNormCode = codesWithName.length === 1 ? codesWithName[0] : undefined;\n }\n }\n return rxNormCode;\n }\n}\n\n/**\n * A set of FHIR resources. All resources that are a part of this set must\n * have the same label.\n */\nexport class FhirResourceSet {\n /**\n * The list of resources that belong together.\n */\n readonly resourceList: T[];\n readonly requestIds: Set;\n\n /*\n * The label for this set of data. All data in this set\n * must have the same label.\n */\n label: string;\n\n /**\n * Constructor for FhirResourceSet.\n * @param resourceList The list of resources belonging together.\n * @throws Error if the resources have different labels, or if there is not\n * a label.\n */\n constructor(resourceList: T[]) {\n this.requestIds = new Set(resourceList.map(resource => resource.requestId));\n\n if (!resourceList) {\n throw new ResultError(this.requestIds, 'Resource list is undefined.');\n }\n\n if (resourceList.length > 0) {\n const firstLabel = resourceList[0].label;\n if (!firstLabel) {\n throw new ResultError(\n this.requestIds, 'The first resource does not have a label.');\n }\n\n const allLabels = new Set(resourceList.map(rs => rs.label.toLowerCase()));\n if (allLabels.size !== 1) {\n throw new ResultError(\n this.requestIds,\n `The resource list in this set has mixed labels: ${\n Array.from(allLabels.values())}`);\n }\n this.label = firstLabel;\n }\n\n this.resourceList = resourceList;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Injectable} from '@angular/core';\nimport {Interval} from 'luxon';\nimport {of} from 'rxjs';\n\nimport {BCHMicrobioCodeGroup} from './clinicalconcepts/bch-microbio-code';\nimport {LOINCCode, LOINCCodeGroup} from './clinicalconcepts/loinc-code';\nimport {RxNormCode} from './clinicalconcepts/rx-norm';\nimport {RxNormCodeGroup} from './clinicalconcepts/rx-norm-group';\nimport {DiagnosticReport} from './fhir-data-classes/diagnostic-report';\nimport {Encounter} from './fhir-data-classes/encounter';\nimport {MedicationAdministration} from './fhir-data-classes/medication-administration';\nimport {MedicationOrder} from './fhir-data-classes/medication-order';\nimport {Observation} from './fhir-data-classes/observation';\n\n@Injectable()\nexport abstract class FhirService {\n /**\n * Returns whether there are any observations with this code in the given\n * time range.\n * @param code The LOINC code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n */\n abstract observationsPresentWithCode(code: LOINCCode, dateRange: Interval):\n Promise;\n\n /**\n * Returns whether there are any observations with this code in the given\n * time range.\n * @param code The BCHMicrobio code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n */\n diagnosticReportsPresentWithCodes(\n codeGroup: BCHMicrobioCodeGroup, dateRange: Interval): Promise {\n // Just ask for one result to reduce the call time.\n return this.getDiagnosticReports(codeGroup, dateRange, 1)\n .then(reports => reports.length > 0, rejection => {\n // If any DiagnosticReports for this code results in an error, do not\n // show any DiagnosticReports at all.\n throw rejection;\n });\n }\n\n /**\n * Gets observations from a specified date range with a specific LOINC code.\n * @param code The LOINC code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount If provided, the maximum number of observations to\n * query for.\n */\n abstract getObservationsWithCode(\n code: LOINCCode,\n dateRange: Interval,\n ): Promise;\n\n /**\n * Gets observations from a specified date range with a specific code group.\n * @param codeGroup The LOINCCodeGroup code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @returns The observations if there's a valid code group or date range.\n */\n getObservationsForCodeGroup(codeGroup: LOINCCodeGroup, dateRange: Interval):\n Promise {\n if (!codeGroup || !dateRange) {\n return of([]).toPromise();\n }\n const observationPromises = new Array>();\n for (const c of codeGroup.resourceCodes) {\n if (c instanceof LOINCCode) {\n observationPromises.push(this.getObservationsWithCode(c, dateRange));\n }\n }\n return Promise.all(observationPromises);\n }\n\n /**\n * Returns whether there are any observations with this code in the given\n * time range.\n * @param code The RxNorm code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n */\n abstract medicationsPresentWithCode(code: RxNormCode, dateRange: Interval):\n Promise;\n\n /**\n * Gets medication data from a specified date range with a specific Rx code\n * group.\n * @param codeGroup The RxNormCode code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount If provided, the maximum number of observations to\n * query for.\n */\n abstract getMedicationAdministrationsWithCode(\n code: RxNormCode, dateRange: Interval,\n limitCount?: number): Promise;\n\n /**\n * Gets medication data from a specified date range with specific Rx codes,\n * since multiple medications are displayed on a single chart.\n * @param codes The RxNormCode codes for which to get observations.\n * @param dateRanges The time interval observations should fall between.\n */\n getMedicationAdministrationsWithCodes(\n codes: RxNormCodeGroup,\n dateRange: Interval): Promise {\n if (!codes || !dateRange) {\n return of([]).toPromise();\n }\n const medicationPromises = new Array>();\n for (const code of codes.resourceCodes) {\n medicationPromises.push(this.getMedicationAdministrationsWithCode(\n code as RxNormCode, dateRange));\n }\n // This will be rejected if any Promise is rejected.\n return Promise.all(medicationPromises)\n .then(\n resolvedMedications =>\n // flatten the results into single medication administrations\n // list\n [].concat(...resolvedMedications));\n }\n\n /**\n * Gets the order for specified order id.\n * @param id The id to pull the order from.\n */\n abstract getMedicationOrderWithId(id: string): Promise;\n\n /**\n * Gets administrations for specified order id.\n * @param id The id to pull the order from.\n */\n abstract getMedicationAdministrationsWithOrder(id: string, code: RxNormCode):\n Promise;\n\n /**\n * Gets the encounters for the patient for any encounter that falls in the\n * given date range.\n * @param dateRange Return all encounters that covered any time in this\n * date range.\n */\n abstract getEncountersForPatient(dateRange: Interval): Promise;\n\n /**\n * Saves the current image of the graphs rendered as a DocumentReference\n * (static save).\n * @param image The image to save in the Document.\n * @param date The date the note was written on.\n */\n abstract saveStaticNote(image: HTMLCanvasElement, date: string):\n Promise;\n\n /**\n * Gets the DiagnosticReports for the patient for any report that falls in\n * the given date range.\n * @param codeGroup The CodeGroup to retrieve DiagnosticReports for.\n * @param dateRange Return all DiagnosticReports that covered any time in this\n * date range.\n */\n abstract getDiagnosticReports(\n codeGroup: BCHMicrobioCodeGroup, dateRange: Interval,\n limitCount?: number): Promise;\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime} from 'luxon';\nimport {CustomizableGraphAnnotation} from '../graphtypes/customizable-graph/customizable-graph-annotation';\n\nimport {GraphData} from './graphdata';\nimport {LabeledSeries} from './labeled-series';\n\n/**\n * CustomizableData holds a time-based series to which a user can add more\n * points.\n */\nexport class CustomizableData extends GraphData {\n /** The display bounds of the y-axis. */\n readonly yAxisDisplayBounds: [number, number];\n\n private constructor(\n series: LabeledSeries,\n /**\n * The annotations for this customizable graph. If populated, holds a\n * map from a number representation of a Date to\n * CustomizableGraphAnnotation for the corresponding point.\n */\n readonly annotations: Map,\n regions?: any[]) {\n super(\n [series], undefined, // tooltip map\n undefined, // tooltip key function\n regions);\n this.annotations = annotations;\n this.yAxisDisplayBounds = [0, 10];\n }\n\n static defaultEmptySeries() {\n return new CustomizableData(\n LabeledSeries.emptySeries(),\n new Map());\n }\n\n /**\n * Adds a point to the series in this CustomizableData object.\n * @param annotation: The annotation to add in to the graph.\n */\n addPointToSeries(annotation: CustomizableGraphAnnotation) {\n // This method assumes there is only 1 series.\n this.series[0].coordinates.push([annotation.timestamp, 0]);\n this.annotations.set(annotation.timestamp.toMillis(), annotation);\n }\n\n /**\n * Removes a point from the series in this CustomizableData object, as well as\n * the corresponding annotation.\n * @param date The date for this point to remove.\n */\n removePointFromSeries(date: DateTime) {\n const index = this.series[0].coordinates.findIndex(\n c => c[0].toMillis() === date.toMillis());\n this.series[0].coordinates.splice(index, 1);\n this.annotations.delete(date.toMillis());\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\n\nimport {LabeledSeries} from './labeled-series';\n\n/**\n * The base class for holding data pertaining to one graph.\n */\nexport class GraphData {\n // The number of decimal places to show for any value associated with this\n // GraphData. The default is 0, to minimize errors caused by unnecessary\n // trailing zeros.\n precision = 0;\n\n constructor(\n /** A list of the series to be displayed on the graph. */\n readonly series: LabeledSeries[] = [],\n\n /**\n * A map to provide tooltips.\n * This is a bit complicated. c3's API lets you specify a function call\n * that will provide the HTML content for any given point's tooltip.\n * As a parameter, it passes in one or more data points:\n * https://c3js.org/reference.html#tooltip-contents\n * so when the tooltip is rendered, all you have is the plotted\n * information. As far as I can tell, that data structure is undocumented.\n * Upon inspection, the data point includes which series it belongs to,\n * the x value, and the y value, so if you want to render a custom\n * tooltip, you have to be able to derive all the information you need\n * from those values.\n * tooltipMap, alongside tooltipKeyFn, helps with this process.\n * If you call tooltipKeyFn on the data object passed into the c3 contents\n * function, it should yield the key into tooltipMap that will let you\n * look up the appropriate tooltip for that data point. If tooltipKeyFn\n * is unset, then we fall back to the default lookup, which is by x-value.\n */\n readonly tooltipMap?: Map,\n /**\n * See documentation on tooltipMap for more detail. tooltipKeyFn\n * takes in a graph data point and returns the key into tooltipMap that\n * provides the tooltip for that data point.\n */\n readonly tooltipKeyFn?: (graphData: any) => string,\n /**\n * A list of x-axis regions to display on the graph.\n */\n readonly xRegions = new Array<[DateTime, DateTime]>()) {}\n\n /*\n * Returns whether or not there are any data points in the series that fall\n * inside the date range provided.\n * @param series The LabeledSeries to find data points in the date range.\n * @param dateRange The date range in which to see if there are any data\n * points.\n */\n dataPointsInRange(dateRange: Interval): boolean {\n const entireRange = Interval.fromDateTimes(\n dateRange.start.toLocal().startOf('day'),\n dateRange.end.toLocal().endOf('day'));\n for (const s of this.series) {\n if (s.hasPointInRange(entireRange)) {\n return true;\n }\n }\n return false;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\n\n// tslint:disable-next-line:max-line-length\nimport {DisplayGrouping, negFinalMB, negOtherMB, negPrelimMB, posFinalMB, posOtherNB, posPrelimMB} from '../clinicalconcepts/display-grouping';\nimport {DiagnosticReport, DiagnosticReportStatus} from '../fhir-data-classes/diagnostic-report';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {MedicationAdministration} from '../fhir-data-classes/medication-administration';\nimport {CHECK_RESULT_CODE, NORMAL} from '../fhir-data-classes/observation-interpretation-valueset';\nimport {LegendInfo} from '../graphtypes/legend-info';\n\nimport {MedicationOrder, MedicationOrderSet} from './../fhir-data-classes/medication-order';\nimport {ObservationSet} from './../fhir-data-classes/observation-set';\n\n/**\n * Timeseries data, represented as a list of tuples,\n * with metadata including a human-readable label, a unit, and a typical range.\n * Used for most charts to display a changing value over time. Multiple\n * LabeledSeries may appear on the same graph.\n */\nexport class LabeledSeries {\n /**\n * The y units for this series.\n */\n unit: string;\n\n /**\n * The DisplayGrouping this LabeledSeries corresponds to.\n */\n concept: DisplayGrouping;\n\n /**\n * A map of DateTimes to corresponding tuples representing the low and high\n * bounds of what should be considered \"normal\" along the y-axis.\n */\n normalRanges = new Map();\n\n /**\n * This is the desired display range for the y-axis for this series. We\n * calculate it as as:\n * [minimum(yNormalBounds, yValues), maximum(yNormalBounds, yValues)]\n */\n readonly yDisplayBounds: [number, number];\n\n constructor(\n /** The descriptive label of the data series. */\n readonly label: string,\n /**\n * The coordinate set for the series. The y-coordinates may be strings\n * or numbers, depending on whether this is a categorical or numerical\n * graph.\n */\n readonly coordinates: Array<[DateTime, string|number, string?]>,\n /** The y-axis unit for this series. */\n unit?: string,\n /**\n * Holds information about how this series should be displayed.\n */\n readonly legendInfo?: LegendInfo,\n /**\n * The x-coordinate values in the labeled series that should be marked as\n * abnormal because of their interpretation results.\n */\n readonly abnormalCoordinates = new Set(),\n /**\n * A map of DateTimes to corresponding tuples representing the low and\n * high bounds of what should be considered \"normal\" along the y-axis.\n */\n normalRanges?: Map,\n /**\n * The DisplayGrouping associated with this LabeledSeries.\n */\n concept?: DisplayGrouping) {\n // Sort the coordinates by x-value.\n this.coordinates = coordinates.sort((a, b) => {\n return a[0].toMillis() - b[0].toMillis();\n });\n this.unit = unit;\n\n // If a specific legend wasn't passed through then we generate one for the\n // series.\n this.legendInfo = legendInfo || new LegendInfo(label);\n\n this.concept = concept;\n this.normalRanges = normalRanges;\n\n /**\n * Calculate the y axis display bounds by finding the outer boundaries of\n * the data and the normal range.\n */\n\n const yValues = this.coordinates.map(c => c[1]).filter(x => x !== null);\n\n if (yValues.map(val => typeof val === 'number').some(x => x === false)) {\n return;\n }\n this.yDisplayBounds =\n [Math.min.apply(Math, yValues), Math.max.apply(Math, yValues)];\n }\n\n /**\n * Generates an empty LabeledSeries.\n */\n static emptySeries() {\n return new LabeledSeries('', []);\n }\n\n\n /**\n * Generates a LabeledSeries from the given ObservationSet.\n * @param observationSet The ObservationSet to chart.\n * @param encounters A list of Encounters to use while determining line breaks\n * in series.\n */\n static fromObservationSet(\n observationSet: ObservationSet, encounters: Encounter[]): LabeledSeries {\n let coordinates: Array<[DateTime, number]> = [];\n const observations = observationSet.resourceList;\n const abnormal = new Set();\n for (const obs of observations) {\n coordinates.push([\n obs.observation.timestamp,\n obs.observation.value ? obs.observation.value.value : null\n ]);\n\n const outsideNormalRange = obs.observation.normalRange &&\n (obs.observation.value.value < obs.observation.normalRange[0] ||\n obs.observation.value.value > obs.observation.normalRange[1]);\n\n if ((obs.observation.interpretation &&\n obs.observation.interpretation.code !== NORMAL) ||\n outsideNormalRange) {\n abnormal.add(obs.observation.timestamp.toISO());\n }\n }\n\n coordinates = this.addEncounterEndpoints(coordinates, encounters);\n return new LabeledSeries(\n observationSet.label, coordinates, observationSet.unit,\n undefined, // legendInfo,\n abnormal, observationSet.normalRanges);\n }\n\n /**\n * Generates a LabeledSeries from the given list of discrete resulted-\n * ObservationSets.\n * For Observations with discrete values, such as \"yellow\"\n * for the color of urine, we group all ObservationSets into one\n * LabeledSeries, at a specific yValue.\n * @param observationSets The discrete ObservationSets to chart.\n * @param yValue The numerical y-value to map to this ObservationSet with\n * discrete results.\n * @param label The label for this LabeledSeries.\n * @param encounters A list of Encounters to use while determining line breaks\n * in series.\n */\n static fromObservationSetsDiscrete(\n observationSets: ObservationSet[], yValue: number, label,\n encounters: Encounter[]): LabeledSeries {\n let coordinates: Array<[DateTime, number | string]> = [];\n const abnormal = new Set();\n for (const obsSet of observationSets) {\n const observations = obsSet.resourceList;\n for (const obs of observations) {\n coordinates.push([obs.observation.timestamp, yValue]);\n\n if (obs.observation.interpretation &&\n obs.observation.interpretation.code !== NORMAL) {\n abnormal.add(obs.observation.timestamp.toISO());\n }\n const outsideNormalRange = obs.observation.normalRange &&\n (obs.observation.value.value < obs.observation.normalRange[0] ||\n obs.observation.value.value > obs.observation.normalRange[1]);\n\n if (obs.observation.value && obs.observation.value.value &&\n outsideNormalRange) {\n abnormal.add(obs.observation.timestamp.toISO());\n }\n }\n }\n coordinates = this.addEncounterEndpoints(coordinates, encounters);\n return new LabeledSeries(\n label, coordinates,\n undefined, // unit\n undefined, // legend info,\n abnormal // abnormal points\n );\n }\n\n /**\n * Generates a set of LabeledSeries from the given MedicationOrderSet. It will\n * return one series for all the orders together since the order set\n * represents all orders for the same medication.\n * @param medOrderSet The MedicationOrderSet to chart.\n * @param dateRange The date range displayed on the chart.\n * @param encounters A list of Encounters to use while determining line breaks\n * in series.\n * @param categoricalYPosition If set, we use this y-position for all the\n * datapoints in both returned series. If unset, we use the dosage\n * quantity for each administration as the y-value.\n */\n static fromMedicationOrderSet(\n medOrderSet: MedicationOrderSet, dateRange: Interval,\n encounters: Encounter[], categoricalYPosition?: string): LabeledSeries {\n const data: LabeledSeries[] = [];\n for (const medOrder of medOrderSet.resourceList) {\n // The first series in fromMedicationOrder is all the administrations.\n // The second series (unused in this function) is the end points only.\n data.push(LabeledSeries.fromMedicationOrder(\n medOrder, dateRange, categoricalYPosition)[0]);\n }\n\n // Combine all the series into a single series so that it shows up with\n // the same color.\n let coords = [];\n for (const series of data) {\n for (const coord of series.coordinates) {\n coords.push(coord);\n }\n }\n\n coords = this.addEncounterEndpoints(coords, encounters);\n return new LabeledSeries(\n medOrderSet.label, coords, medOrderSet.unit,\n undefined, // legendInfo\n undefined, // abnormal points\n // Always keep normalRanges undefined for MedicationOrder-based\n // LabeledSeries, as we only show normal ranges for Observations with a\n // normal range given in the data.\n undefined, // normalRanges\n medOrderSet.rxNormCode ? medOrderSet.rxNormCode.displayGrouping :\n undefined);\n }\n\n /**\n * Generates a set of LabeledSeries from the given MedicationOrder. For each\n * order, there are two LabeledSeries -- one for the corresponding\n * MedicationAdministrations, and one for the endpoints displayed for the\n * order.\n * @param order The MedicationOrder to chart.\n * @param dateRange The date range displayed on the chart.\n * @param categoricalYPosition If set, we use this categorical y-position\n * for all the datapoints in both returned series. If unset, we use the\n * dosage quantity for each administration as the numerical y-value.\n */\n static fromMedicationOrder(\n order: MedicationOrder, dateRange: Interval,\n categoricalYPosition?: string): LabeledSeries[] {\n const coordinates = new Array<[DateTime, string | number, string?]>();\n const endpointCoordinates = new Array<[DateTime, string | number]>();\n const medAdminsForOrder = order.administrationsForOrder;\n\n const label = order.label + order.orderId;\n const legend = order.rxNormCode.displayGrouping;\n\n if (medAdminsForOrder) {\n for (const annotatedAdmin of medAdminsForOrder.resourceList) {\n coordinates.push([\n annotatedAdmin.medAdministration.timestamp,\n this.getYPositionForMed(\n annotatedAdmin.medAdministration, categoricalYPosition)\n ]);\n }\n // We add the beginning and end time stamp if the order is not fully\n // displayed-- so that no dashes are displayed when an order is being\n // carried over from before the time window displayed.\n // We only display an endpoint for a MedicationOrder if the\n // endpoint is visible -- that is, if the time of the first\n // Administration of the order is during or after the beginning of the\n // time range of the chart, and if the time of the last Administration\n // of the order is before the end of the chart's time range.\n const firstAdministrationIsAfterStartTime =\n order.firstAdministration.timestamp.toMillis() >=\n dateRange.start.toMillis();\n const lastAdministrationIsBeforeEndTime =\n order.lastAdmininistration.timestamp.toMillis() <=\n dateRange.end.toMillis();\n\n if (firstAdministrationIsAfterStartTime) {\n endpointCoordinates.push([\n order.firstAdministration.timestamp,\n this.getYPositionForMed(\n order.firstAdministration, categoricalYPosition)\n ]);\n } else if (\n categoricalYPosition &&\n (order.lastAdmininistration.timestamp.toMillis() >\n dateRange.start.toMillis())) {\n // Only add a point for continuity if we have a fixed y position.\n coordinates.push([dateRange.start, categoricalYPosition]);\n }\n if (lastAdministrationIsBeforeEndTime) {\n endpointCoordinates.push([\n order.lastAdmininistration.timestamp,\n this.getYPositionForMed(\n order.lastAdmininistration, categoricalYPosition)\n ]);\n } else if (\n categoricalYPosition &&\n order.firstAdministration.timestamp.toMillis() <\n dateRange.end.toMillis()) {\n // Only add a point for continuity if we have a fixed y position.\n coordinates.push([dateRange.end, categoricalYPosition]);\n }\n }\n\n return [\n new LabeledSeries(\n label, coordinates, medAdminsForOrder.unit, legend,\n undefined, // abnormal points\n // Always keep normalRanges undefined for MedicationOrder-based\n // LabeledSeries, as we only show normal ranges for Observations with\n // a normal range given in the data.\n undefined, // normalRanges\n order.rxNormCode.displayGrouping),\n new LabeledSeries(\n 'endpoint' + label, endpointCoordinates, medAdminsForOrder.unit,\n legend)\n ];\n }\n\n /**\n * Generates a LabeledSeries from the given initial date and y-value.\n * @param date The DateTime corresponding to the initial point to chart.\n * @param yValue The y-value for the initial point to chart.\n */\n static fromInitialPoint(date: DateTime, yValue: number) {\n return new LabeledSeries('', [[date, yValue]]);\n }\n\n /**\n * Generates LabeledSeries from the given DiagnosticReport.\n * @param report The DiagnosticReport to chart.\n * @param date the DateTime corresponding to the Observations in the\n * DiagnosticReport.\n */\n static fromDiagnosticReport(report: DiagnosticReport, date: DateTime):\n LabeledSeries[] {\n const series = [];\n const interpretationMap = new Map>();\n // Sort results by interpretation, and make a LabeledSeries for each.\n for (const observation of report.results) {\n const categoricalYValue = observation.display;\n const interpretation = observation.interpretation.code;\n if (interpretationMap.get(interpretation)) {\n const existing = interpretationMap.get(interpretation);\n existing.push([date, categoricalYValue]);\n interpretationMap.set(interpretation, existing);\n } else {\n interpretationMap.set(interpretation, [[date, categoricalYValue]]);\n }\n }\n // Make a LabeledSeries for each interpretation.\n for (const interpretation of Array.from(interpretationMap.keys())) {\n const seriesLabel =\n report.id + '-' + interpretation + '-' + report.status;\n const isPositive = seriesLabel.includes(CHECK_RESULT_CODE);\n series.push(new LabeledSeries(\n // Encode the status and interpretation into the series name so that\n // we can use d3 later on to filter the data points and display them\n // with the correct styling.\n seriesLabel, interpretationMap.get(interpretation),\n undefined, // unit\n LabeledSeries.getLegendInfoFromResult(report.status, isPositive)));\n }\n return series;\n }\n\n /**\n * Returns the correct legend info for a diagnostic report.\n * @param status The DiagnosticReport's status.\n * @param isPositive Whether the report appears to be positive.\n * @returns The correct legend info for the report.\n */\n private static getLegendInfoFromResult(\n status: DiagnosticReportStatus, isPositive: boolean): LegendInfo {\n if (isPositive) {\n if (status === DiagnosticReportStatus.Preliminary) {\n return posPrelimMB;\n } else if (status === DiagnosticReportStatus.Final) {\n return posFinalMB;\n }\n return posOtherNB;\n } else {\n if (status === DiagnosticReportStatus.Preliminary) {\n return negPrelimMB;\n } else if (status === DiagnosticReportStatus.Final) {\n return negFinalMB;\n }\n return negOtherMB;\n }\n }\n\n private static getYPositionForMed(\n medAdmin: MedicationAdministration, categoricalYPosition: string): string\n |number {\n return categoricalYPosition !== undefined && categoricalYPosition !== null ?\n categoricalYPosition :\n medAdmin.dosage.quantity;\n }\n\n private static addEncounterEndpoints(\n coordinates: any[], encounters: Encounter[]): any[] {\n if (coordinates.length > 0) {\n // If any encounters are set for this MedicationOrderSet, add null values\n // to the endpoints of encounters to ensure line breakage between points\n // of different encounters.\n // We assume that encounter endpoints correspond to correct line breaks,\n // and do not cross-check encounter id's of MedicationOrders or\n // MedicationAdministrations.\n coordinates = coordinates.sort((a, b) => a[0] - b[0]);\n for (const encounter of encounters) {\n coordinates.unshift([encounter.period.start.toUTC(), null]);\n coordinates.push([encounter.period.end.toUTC(), null]);\n }\n }\n return coordinates;\n }\n\n hasPointInRange(dateRange: Interval) {\n for (const x of this.coordinates.map(c => c[0])) {\n if (dateRange.contains(x)) {\n return true;\n }\n }\n return false;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {DateTime, Interval} from 'luxon';\n\nimport {ResourceCodeGroup} from '../clinicalconcepts/resource-code-group';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {MedicationOrderSet} from '../fhir-data-classes/medication-order';\nimport {ObservationSet} from '../fhir-data-classes/observation-set';\nimport {MedicationAdministrationTooltip} from '../graphtypes/tooltips/medication-tooltips';\n// tslint:disable-next-line:max-line-length\nimport {DiscreteObservationTooltip, GenericAbnormalTooltip, GenericAnnotatedObservationTooltip} from '../graphtypes/tooltips/observation-tooltips';\nimport {NORMAL} from '../fhir-data-classes/observation-interpretation-valueset';\nimport {bloodPressureLoincs} from '../clinicalconcepts/resource-code-manager-exports';\n\nimport {GraphData} from './graphdata';\nimport {LabeledSeries} from './labeled-series';\n\n/**\n * LineGraphData holds configurations for a line graph. A line graph may display\n * one or more LabeledSeries.\n */\nexport class LineGraphData extends GraphData {\n /** The tick marks to display on the y axis. */\n readonly yTicks: number[];\n\n /**\n * Contains the ResourceCodeGroup for this set of data, which helps determine\n * whether to force display bounds, and the code group's display bounds.\n */\n readonly resourceGroup: ResourceCodeGroup;\n\n\n\n private constructor(\n /** The label for the graph. */\n readonly label: string,\n /** The LabeledSeries that are a part of this line graph. */\n series: LabeledSeries[],\n /** The minimum and maximum y-values for this data. */\n readonly yAxisDataBounds: [number, number],\n /** The unit for the y-axis of the graph. */\n readonly unit: string, tooltipMap?: Map,\n tooltipKeyFn?: (key: string) => string, regions?: any[],\n precision?: number, resourceCodeGroup?: ResourceCodeGroup) {\n super(series, tooltipMap, tooltipKeyFn, regions);\n this.precision = precision ? precision : 0;\n this.yTicks =\n LineGraphData.getYTicks(yAxisDataBounds[0], yAxisDataBounds[1]);\n this.resourceGroup = resourceCodeGroup;\n }\n\n static emptyData() {\n return new LineGraphData('', [], [0, 0], '');\n }\n\n /**\n * Converts a list of ObservationSets to a LineGraphData object.\n * @param label The label for this set of observations.\n * @param observationGroup A list of ObservationSets to display.\n * @param resourceCodeGroup The ResourceCodeGroup these ObservationSets belong\n * to\n * @param sanitizer A DOM sanitizer for use in tooltip construction\n * @param encounters A list of Encounters to use while determining line breaks\n * in series.\n * @returns a new LineGraphData for this observation set.\n * @throws Error if the observations in observationGroup have different units.\n */\n static fromObservationSetList(\n label: string, observationGroup: ObservationSet[],\n resourceCodeGroup: ResourceCodeGroup, sanitizer: DomSanitizer,\n encounters: Encounter[]): LineGraphData {\n let minY: number = Number.MAX_VALUE;\n let maxY: number = Number.MIN_VALUE;\n\n const allSeries = [];\n const obsGroupToSeries = new Map();\n for (const obsSet of observationGroup) {\n const lblSeries = LabeledSeries.fromObservationSet(obsSet, encounters);\n obsGroupToSeries.set(obsSet, lblSeries);\n allSeries.push(lblSeries);\n /* Find the minimum and maximum y values for all the series. */\n if (lblSeries.yDisplayBounds) {\n minY = Math.min(minY, lblSeries.yDisplayBounds[0]);\n maxY = Math.max(maxY, lblSeries.yDisplayBounds[1]);\n }\n }\n\n let tooltipMap = LineGraphData.makeTooltipMap(obsGroupToSeries, sanitizer);\n\n tooltipMap = LineGraphData.addAbnormalValueTooltips(\n tooltipMap, sanitizer, allSeries);\n\n const allUnits =\n new Set(observationGroup.map(x => x.unit).filter(x => x !== undefined));\n\n const data = new LineGraphData(\n label, allSeries, [minY, maxY], allUnits.values().next().value,\n tooltipMap && tooltipMap.size > 0 ? tooltipMap : undefined,\n undefined, // tooltipMap\n undefined, // regions\n resourceCodeGroup.precision, resourceCodeGroup);\n return data;\n }\n\n /**\n * Manually find y axis tick values based on the min and max display bounds.\n */\n static getYTicks(min: number, max: number, tickCount = 4): number[] {\n // Evenly space out 5 numbers between the min and max (display bounds).\n const difference = max - min;\n const spacing = difference / tickCount;\n const values = [];\n // If there is no difference between the min and max, simply return the\n // min.\n if (spacing === 0) {\n return [min];\n }\n for (let curr = min; curr <= max; curr += spacing) {\n values.push(curr);\n }\n return values;\n }\n\n\n private static makeTooltipMap(\n obsGroupToSeries: Map,\n sanitizer: DomSanitizer,\n ): Map {\n const tooltipMap = new Map();\n\n for (const entry of Array.from(obsGroupToSeries.entries())) {\n const obsGroup: ObservationSet = entry[0];\n const series: LabeledSeries = entry[1];\n for (const obs of obsGroup.resourceList) {\n const isAbnormal = series.abnormalCoordinates.has(obs.observation.timestamp.toISO());\n const timestamp = obs.observation.timestamp.toMillis().toString();\n // The key for this tooltip is the administration's timestamp.\n // There may be multiple data points associated with the timestamp\n // so we stack the administrations on top of one another in that case.\n if (tooltipMap.get(timestamp)) {\n // Blood pressure is read into the ObservationSet differently,\n // causing an edge case in the presentation of the values in the\n // tooltips. We only want to display 'Blood pressure' once\n if (obs.observation.codes[0].codeString === bloodPressureLoincs[0].codeString\n && tooltipMap.get(timestamp).includes(bloodPressureLoincs[0].label)) {\n continue;\n }\n tooltipMap.set(\n timestamp,\n tooltipMap.get(timestamp) +\n new GenericAnnotatedObservationTooltip(\n false, series.legendInfo.fill)\n .getTooltip(obs, sanitizer, isAbnormal));\n } else {\n tooltipMap.set(\n timestamp,\n new GenericAnnotatedObservationTooltip(\n true, series.legendInfo.fill)\n .getTooltip(obs, sanitizer, isAbnormal));\n }\n }\n }\n return tooltipMap;\n }\n\n /**\n * Constructs a map of timestamps to GenericAbnormalTooltips for any point\n * with an \"abnormal\" value. Currently, we only use the normal range as\n * reference.\n * @param series The series to construct the tooltip map for.\n * @param tooltipMap The existing tooltips for the series.\n * @param obsLabelToColor A map of Observation label to corresponding color.\n * @param sanitizer A DOM sanitizer for use in tooltip construction\n * @returns a map of timstamp strings to tooltips, with GenericObservation\n * tooltips replaced with GenericAbnormal tooltip if the value is\n * abnormal.\n */\n private static addAbnormalValueTooltips(\n tooltipMap: Map,\n sanitizer: DomSanitizer,\n labeledSeries: LabeledSeries[],\n ): Map {\n const alreadyMarked = new Set();\n for (const series of labeledSeries) {\n // Add a tooltip for any value with an abnormal value.\n for (const coords of series.coordinates) {\n const timestamp = coords[0].toMillis().toString();\n if (series.abnormalCoordinates.has(coords[0].toISO())) {\n const params = {};\n params['timestamp'] = coords[0].toMillis();\n params['value'] = coords[1];\n params['label'] = series.label;\n params['unit'] = series.unit;\n // The key for this tooltip is the timestamp.\n // There may be multiple data points associated with the\n // timestamp so we stack the administrations on top of one\n // another in that case.\n if (tooltipMap.get(timestamp) && !alreadyMarked.has(timestamp)) {\n tooltipMap.set(\n timestamp,\n tooltipMap.get(timestamp) +\n new GenericAbnormalTooltip(false, series.legendInfo.fill)\n .getTooltip(params, sanitizer));\n alreadyMarked.add(timestamp);\n } else if (!tooltipMap.get(timestamp)) {\n tooltipMap.set(\n timestamp,\n new GenericAbnormalTooltip(true, series.legendInfo.fill)\n .getTooltip(params, sanitizer));\n }\n }\n }\n return tooltipMap;\n }\n }\n\n /**\n * Converts a list of MedicationOrderSets to a LineGraphData object.\n * @param medicationOrderListGroup A list of MedicationOrderSets to\n * display.\n * @param encounters A list of Encounters to use while determining line\n * breaks in series.\n * @returns a new LineGraphData for this observation set.\n * @throws Error if the medication administrations in medicationOrderSet\n * have different units.\n */\n static fromMedicationOrderSet(\n medicationOrderSet: MedicationOrderSet, dateRange: Interval,\n sanitizer: DomSanitizer, encounters: Encounter[]): LineGraphData {\n const tooltipMap = new Map();\n const regions = new Array<[DateTime, DateTime]>();\n for (const order of medicationOrderSet.resourceList) {\n regions.push([\n order.firstAdministration.timestamp,\n order.lastAdmininistration.timestamp\n ]);\n for (const admin of order.administrationsForOrder.resourceList) {\n const timestamp =\n admin.medAdministration.timestamp.toMillis().toString();\n // The key for this tooltip is the administration's timestamp.\n // There may be multiple data points associated with the timestamp\n // so we stack the administrations on top of one another in that\n // case.\n const tooltipText = new MedicationAdministrationTooltip().getTooltip(\n [admin], sanitizer);\n if (tooltipMap.get(timestamp)) {\n tooltipMap.set(timestamp, tooltipMap.get(timestamp) + tooltipText);\n } else {\n tooltipMap.set(timestamp, tooltipText);\n }\n }\n }\n\n return new LineGraphData(\n medicationOrderSet.label,\n [LabeledSeries.fromMedicationOrderSet(\n medicationOrderSet, dateRange, encounters)],\n [medicationOrderSet.minDose, medicationOrderSet.maxDose],\n medicationOrderSet.unit, tooltipMap, undefined, regions);\n }\n\n /**\n * Converts a list of ObservationSets with discrete y-values (results) to\n * a LineGraphData object. If we are graphing Observations with discrete\n * values, such as \"yellow\" for the color of urine, we group all\n * ObservationSets into one LabeledSeries, and display textual information\n * in the tooltip.\n * @param label The label for this set of observations.\n * @param observationGroup A list of ObservationSets to display.\n * @param encounters A list of Encounters to use while determining line\n * breaks in series.\n * @returns a new LineGraphData for this observation set.\n * @throws Error if the observations in observationGroup have different\n * units.\n */\n static fromObservationSetListDiscrete(\n label: string, observationGroup: ObservationSet[],\n sanitizer: DomSanitizer, encounters: Encounter[]): LineGraphData {\n // For ObservationSets with discrete categories, we display a\n // scatterplot with one series, with most information in the tooltip.\n const yValue = 10;\n const lblSeries = LabeledSeries.fromObservationSetsDiscrete(\n observationGroup, yValue, label, encounters);\n\n let tooltipMap = new Map();\n for (const observationSet of observationGroup) {\n for (const obs of observationSet.resourceList) {\n const isAbnormal = (obs.observation.interpretation &&\n obs.observation.interpretation.code !== NORMAL) ?\n true : false;\n const tsString = obs.observation.timestamp.toMillis().toString();\n // Only add the timestamp to the tooltip for the first entry.\n let tooltipText: string;\n if (obs.observation.value) {\n tooltipText =\n new GenericAnnotatedObservationTooltip(\n !tooltipMap.has(tsString), lblSeries.legendInfo.fill)\n .getTooltip(obs, sanitizer, isAbnormal);\n } else {\n tooltipText =\n new DiscreteObservationTooltip(!tooltipMap.has(tsString))\n .getTooltip([obs.observation], sanitizer);\n }\n\n // The key for this tooltip is the observation's timestamp.\n // There may be multiple data points associated with the timestamp\n // so we stack the tooltips on top of one another in that case.\n if (tooltipMap.has(tsString)) {\n tooltipMap.set(tsString, tooltipMap.get(tsString) + tooltipText);\n } else {\n tooltipMap.set(tsString, tooltipText);\n }\n }\n }\n tooltipMap = LineGraphData.addAbnormalValueTooltips(\n tooltipMap, sanitizer, [lblSeries]);\n\n return new LineGraphData(\n label, [lblSeries], [0, yValue * 2], undefined, // Units\n tooltipMap);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\n\nimport {AnnotatedDiagnosticReport} from '../fhir-data-classes/annotated-diagnotic-report';\nimport {DiagnosticReport} from '../fhir-data-classes/diagnostic-report';\nimport {MicrobioTooltip} from '../graphtypes/tooltips/microbio-tooltips';\nimport {CHECK_RESULT_CODE} from 'src/app/fhir-data-classes/observation-interpretation-valueset';\n\nimport {LabeledSeries} from './labeled-series';\nimport {StepGraphData} from './stepgraphdata';\n\n/**\n * MicrobioGraphData holds configurations for a microbiology graph. The format\n * of a microbiology graph is simliar to a step graph in that each y-axis\n * position represents a single microbiology test, and points plotted along\n * that position represent results for that test.\n */\n\nexport class MicrobioGraphData extends StepGraphData {\n private constructor(\n endpointSeries: LabeledSeries[], tooltipMap: Map) {\n super(endpointSeries, tooltipMap, undefined);\n }\n\n /**\n * Converts a list of DiagnosticReports to a StepGraphData object.\n * All DiagnosticReports in the list should belong to the same culture type.\n * @param diagnosticReports A list of DiagnosticReports to display.\n * @returns a new StepGraphData for this set.\n */\n static fromDiagnosticReports(\n diagnosticReports: DiagnosticReport[],\n sanitizer: DomSanitizer): MicrobioGraphData {\n const points: LabeledSeries[] = [];\n\n const tooltipMap = new Map();\n\n for (const report of diagnosticReports) {\n // Get the timestamp from the collection time of the specimen.\n const specimen = report.specimen;\n if (specimen) {\n const annotatedReport = new AnnotatedDiagnosticReport(report);\n for (const series of LabeledSeries.fromDiagnosticReport(\n report, annotatedReport.timestamp)) {\n points.push(series);\n const isAbnormal = series.label.includes(CHECK_RESULT_CODE);\n const color = series.legendInfo.fill;\n // For this tooltip, the keys are timestamps.\n if (tooltipMap.has(annotatedReport.timestamp.toMillis().toString())) {\n const existingTT =\n tooltipMap.get(annotatedReport.timestamp.toMillis().toString());\n tooltipMap.set(\n annotatedReport.timestamp.toMillis().toString(),\n existingTT +\n new MicrobioTooltip(false, color).getTooltip(\n annotatedReport, sanitizer, isAbnormal));\n } else {\n tooltipMap.set(\n annotatedReport.timestamp.toMillis().toString(),\n new MicrobioTooltip(true, color).getTooltip(\n annotatedReport, sanitizer, isAbnormal));\n }\n }\n }\n }\n\n return new MicrobioGraphData(points, tooltipMap);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {DateTime, Interval} from 'luxon';\n\nimport {MedicationOrderSet} from '../fhir-data-classes/medication-order';\nimport {MedicationTooltip} from '../graphtypes/tooltips/medication-tooltips';\n\nimport {GraphData} from './graphdata';\nimport {LabeledSeries} from './labeled-series';\n\n/**\n * StepGraphData holds configurations for a step graph. A step graph displays\n * one or more LabeledSeries.\n */\n\nexport class StepGraphData extends GraphData {\n constructor(\n /** A list of the LabeledSeries data to plot. */\n dataSeries: LabeledSeries[],\n /** A list of the LabeledSeries representing end points. */\n // readonly endpointSeries: LabeledSeries[],\n /** A map of tooltips for the data points. */\n tooltipMap: Map,\n /**\n * The function to call to get the key for the tooltip map for a point.\n */\n keyFn: (data: string) => string) {\n super(dataSeries, tooltipMap, keyFn);\n }\n\n /**\n * Converts a list of MedicationOrderSets to a StepGraphData object.\n * @param medicationOrderListGroup A list of MedicationOrderSets to display.\n * @returns a new StepGraphData for this observation set.\n * @throws Error if the observations in observationGroup have different units.\n */\n static fromMedicationOrderSetList(\n medicationOrderListGroup: MedicationOrderSet[], dateRange: Interval,\n sanitizer: DomSanitizer): StepGraphData {\n const data: LabeledSeries[] = [];\n const endpoints: LabeledSeries[] = [];\n\n medicationOrderListGroup = medicationOrderListGroup.sort((a, b) => {\n return a.resourceList[a.resourceList.length - 1]\n .lastAdmininistration.timestamp.toMillis() -\n b.resourceList[b.resourceList.length - 1]\n .lastAdmininistration.timestamp.toMillis();\n });\n\n const tooltipMap = new Map();\n for (const medOrderSet of medicationOrderListGroup) {\n // Each MedicationOrderSet represents multiple MedicationOrders\n // for the same medicine.\n for (const medOrder of medOrderSet.resourceList) {\n const labeledSeries = LabeledSeries.fromMedicationOrder(\n medOrder, dateRange, medOrder.administrationsForOrder.label);\n const administrationSeries = labeledSeries[0];\n const endpointSeries = labeledSeries[1];\n data.push(administrationSeries);\n endpoints.push(endpointSeries);\n\n // For this custom tooltip, the key is the series ID, and the value is\n // the medication tooltip that shows the first and last doses for the\n // medication.\n tooltipMap.set(\n medOrderSet.rxNormCode.label.toLowerCase() +\n medOrder.firstAdministration.timestamp,\n new MedicationTooltip().getTooltip(medOrder, sanitizer));\n tooltipMap.set(\n medOrderSet.rxNormCode.label.toLowerCase() +\n medOrder.lastAdmininistration.timestamp,\n new MedicationTooltip().getTooltip(medOrder, sanitizer));\n }\n }\n // Do not display the units for Medication administration values on the card\n // for MedicationSummary.\n for (const series of data) {\n series.unit = undefined;\n }\n for (const series of endpoints) {\n series.unit = undefined;\n }\n return new StepGraphData(\n endpoints, // do not render medication administrations, only endpoints\n tooltipMap,\n // Our tooltip key here is the drug name plus the timestamp.\n (tooltipContext: any) => {\n const xValue = tooltipContext.dataPoints[0].label;\n const yValue = tooltipContext.dataPoints[0].value;\n return yValue.toLowerCase() +\n DateTime.fromISO(xValue).toMillis().toString();\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\n\nimport {Axis} from './axis';\n\n/**\n * An AxisGroup is a set of Axes that should be rendered on a single card\n * together.\n *\n * Upon construction, the AxisGroup kicks off a FHIR call to determine whether\n * there is data available for the AxisGroup within the time span of the\n * application. When the promise returns, its result is stored in the\n * dataAvailable class variable.\n *\n * None of the information in AxisGroup changes over the application's\n * lifecycle.\n */\nexport class AxisGroup {\n /**\n * Whether there is data available in the app timescope for this axis group.\n * Marked as public because Angular templates need to get to it, and marked\n * as mutable since it's changed by a promise result, but its value is only\n * set once.\n */\n dataAvailable: boolean = undefined;\n\n /**\n * Constructs an AxisGroup.\n *\n * If label is unset in the constructor, then every axis in axes must have\n * the same label for the constructor to succeed. Similarly, if displayGroup\n * is unset, every axis must have the same resourceGroup.displayGrouping.\n */\n constructor(\n /**\n * The set of axes to be displayed in the same grouping.\n */\n readonly axes: Axis[],\n /**\n * The label for this axis group. If it isn't set here, we'll set it\n * using the label of the contained axes.\n */\n readonly label?: string,\n /**\n * The display grouping for this axis group. If it isn't set here, we'll\n * set it using the display grouping of the contained axes.\n */\n readonly displayGroup?: DisplayGrouping) {\n if (!label) {\n const labelSet = new Set(axes.map(axis => axis.label));\n if (labelSet.size !== 1) {\n throw Error(\n 'The axis group has multiple labels, so we can\\'t pick just one: ' +\n Array.from(labelSet.entries()));\n }\n this.label = axes[0].label;\n }\n\n if (!displayGroup) {\n const allDisplayGroups =\n new Set(axes.map(axis => axis.resourceGroup.displayGrouping.label));\n if (allDisplayGroups.size !== 1) {\n throw Error(\n 'All axes on the same card need to have the same display grouping. Groups:' +\n Array.from(new Set(\n axes.map(axis => axis.resourceGroup.displayGrouping.label))));\n }\n this.displayGroup = axes[0].resourceGroup.displayGrouping;\n }\n\n // Go ahead and make the calls to get whether the data is available.\n Promise.resolve(this.dataAvailableInAppTimeScope());\n }\n\n /**\n * Returns whether there is any data available for any axes in this group\n * within the time scope of the app.\n */\n dataAvailableInAppTimeScope(): Promise {\n if (this.dataAvailable !== undefined) {\n return Promise.resolve(this.dataAvailable);\n }\n return Promise\n .all(this.axes.map(axis => axis.dataAvailableInAppTimeScope()))\n .then(rsc => {\n this.dataAvailable = rsc.some(r => r === true);\n return this.dataAvailable;\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {Interval} from 'luxon';\n\nimport {BCHMicrobioCode, BCHMicrobioCodeGroup} from '../clinicalconcepts/bch-microbio-code';\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\nimport {LOINCCode, LOINCCodeGroup} from '../clinicalconcepts/loinc-code';\nimport {ResourceCodeGroup} from '../clinicalconcepts/resource-code-group';\nimport {RxNormCode} from '../clinicalconcepts/rx-norm';\nimport {RxNormCodeGroup} from '../clinicalconcepts/rx-norm-group';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {MedicationOrder, MedicationOrderSet} from '../fhir-data-classes/medication-order';\nimport {FhirService} from '../fhir.service';\nimport {GraphData} from '../graphdatatypes/graphdata';\nimport {LineGraphData} from '../graphdatatypes/linegraphdata';\nimport {MicrobioGraphData} from '../graphdatatypes/microbiographdata';\nimport {StepGraphData} from '../graphdatatypes/stepgraphdata';\n\nimport {ChartType} from './graph/graph.component';\n\n/**\n * An axis represents one graph to be rendered. It\n * holds values for the type of graph (step, scatter, line, etc) as well as the\n * actual graph data.\n *\n * One axis might have multiple ResourceCodes associated with it, but all of\n * the same type.\n *\n * This class makes the FHIR calls to grab the associated data for the chart.\n */\nexport class Axis {\n /**\n * The chart type for this graph.\n */\n readonly chartType: ChartType;\n\n /**\n * The date range the data is currently loaded for.\n */\n dateRange: Interval;\n\n /**\n * Holds the GraphData already resolved for the class's current date range,\n * unless it hasn't been resolved yet. Then this variable will be undefined,\n * and you need to call updateDateRange to get the data loaded in.\n */\n alreadyResolvedData: GraphData;\n\n /**\n * The associated DisplayGrouping for this graph.\n */\n displayConcept: DisplayGrouping;\n\n /*\n * The label for this axis.\n */\n label: string;\n\n /*\n * Whether to show tick marks for this axis (only changed when results are all\n * qualitative).\n */\n showTicks = true;\n\n /** An error message if there's an error in data retrieval. */\n errorMessage: string;\n\n // The encounters for the date range.\n private encounters: Encounter[] = [];\n\n // Holds the grouping of the resource codes for this axis.\n private allLoinc: boolean;\n private allRx: boolean;\n private allBCHMicrobio: boolean;\n\n /**\n * The constructor for this axis.\n * @param fhirService The FhirService used to make the FHIR calls.\n * @param resourceGroup The ResourceGroup to request data for.\n * @param dateRange: The date range to display on the axis.\n * @param label?: The optional y-axis label for this axis.\n */\n constructor(\n private fhirService: FhirService, private sanitizer: DomSanitizer,\n /**\n * The ResourceCodeGroup for this axis.\n */\n readonly resourceGroup: ResourceCodeGroup,\n /*\n * The label for this axis.\n */\n label?: string) {\n this.chartType = resourceGroup.chartType;\n this.displayConcept = resourceGroup.displayGrouping;\n this.label = label;\n\n const resourceCodeList = this.resourceGroup.resourceCodes;\n // Check that all elements of the resourceCodeList are of the same type.\n this.allLoinc = resourceCodeList.every(code => code instanceof LOINCCode);\n this.allRx = resourceCodeList.every(code => code instanceof RxNormCode);\n this.allBCHMicrobio =\n resourceCodeList.every(code => code instanceof BCHMicrobioCode);\n if (!this.allLoinc && !this.allRx && !this.allBCHMicrobio) {\n throw Error('All resource codes must be of the same type.');\n }\n }\n\n /**\n * Changes this axis' date range and loads in the new graph data accordingly.\n */\n updateDateRange(dateRange: Interval): Promise {\n if (dateRange === this.dateRange) {\n return Promise.resolve(this.alreadyResolvedData);\n }\n // Invalidate the already-resolved data so that the graph data promise\n // has to be re-evaluated.\n this.dateRange = dateRange;\n this.alreadyResolvedData = undefined;\n return this.getDataFromFhir(dateRange).then(\n data => {\n this.alreadyResolvedData = data;\n return data;\n },\n rejection => {\n if (rejection instanceof Error) {\n this.errorMessage = rejection.message;\n } else {\n this.errorMessage = JSON.stringify(rejection, null, 4);\n }\n return LineGraphData.emptyData();\n });\n }\n\n /**\n * Returns whether there is data available for this axis within the\n * application's time scope.\n */\n dataAvailableInAppTimeScope(): Promise {\n return this.resourceGroup.dataAvailableInAppTimeScope();\n }\n\n /**\n * Gets the appropriate GraphData by classifying the resource codes and\n * making the appropriate FHIR calls for data and transformations. If\n * the data is already set in this class, it just returns that data.\n *\n * @returns A GraphData promise that will resolve to the GraphData for\n * this axis's resourceGroup.\n */\n private getDataFromFhir(dateRange: Interval): Promise {\n if (this.alreadyResolvedData) {\n return Promise.resolve(this.alreadyResolvedData);\n }\n\n // Set the encounters for this date range. If the promise fails, the list of\n // encounters is empty.\n this.fhirService.getEncountersForPatient(dateRange).then(e => {\n if (!e) {\n e = [];\n }\n e = e.sort(\n (a, b) => a.period.start.toMillis() - b.period.start.toMillis());\n this.encounters = e;\n }, reject => this.encounters = []);\n\n if (this.allRx) {\n // Prescriptions can be plotted as a step chart or as a line chart.\n if (this.chartType === ChartType.STEP) {\n return this.getStepGraphDataForMedicationSummary(\n this.resourceGroup as RxNormCodeGroup, dateRange);\n } else {\n return this.getLineGraphDataForMedicationDetail(\n this.resourceGroup as RxNormCodeGroup, dateRange);\n }\n }\n\n if (this.allBCHMicrobio) {\n // Microbiology always shows up as a step chart.\n return this.getStepGraphDataForMB(\n this.resourceGroup as BCHMicrobioCodeGroup, dateRange);\n } else {\n // In this case it is all LOINC codes.\n // We use LineGraphData for both ChartType.Scatter and\n // ChartType.Line, for plotting LOINC Codes.\n return (this.resourceGroup as LOINCCodeGroup)\n .getResourceSet(dateRange)\n .then(obsSetList => {\n if (obsSetList) {\n const allUnits = new Set(\n obsSetList.map(x => x.unit).filter(x => x !== undefined));\n // If the observation set contains any qualitative\n // values, even if it's mixed in with quantitative values,\n // we display the discrete linegraph. Similarly, if the\n // observations have different units we display it as a discrete\n // line graph.\n if (obsSetList.some(obsSet => obsSet.anyQualitative) ||\n allUnits.size > 1) {\n this.showTicks = false;\n return LineGraphData.fromObservationSetListDiscrete(\n this.displayConcept.label, obsSetList, this.sanitizer,\n this.encounters);\n }\n return LineGraphData.fromObservationSetList(\n this.displayConcept.label, obsSetList, this.resourceGroup,\n this.sanitizer, this.encounters);\n }\n return LineGraphData.emptyData();\n });\n }\n }\n\n /**\n * Get the data needed for the medication summary.\n * We first get the MedicationAdministrations corresponding to the RxNorms to\n * display on the page, and group them by order id (representing a\n * prescription). We then get the MedicationOrder for each order id, and group\n * those into MedicationOrderSets, where each MedicationOrderSet represents a\n * set of MedicationOrders for a particular medication.\n * @param rxNorms The RxNorms to be displayed in the StepGraphCard.\n */\n getStepGraphDataForMedicationSummary(\n rxNorms: RxNormCodeGroup, dateRange: Interval): Promise {\n return rxNorms.getResourceSet(dateRange).then(medOrderSets => {\n return StepGraphData.fromMedicationOrderSetList(\n medOrderSets.map(x => x.orders), dateRange, this.sanitizer);\n });\n }\n\n getStepGraphDataForMB(bchCodes: BCHMicrobioCodeGroup, dateRange: Interval):\n Promise {\n return bchCodes.getResourceSet(dateRange).then(diagReports => {\n return MicrobioGraphData.fromDiagnosticReports(\n diagReports, this.sanitizer);\n });\n }\n\n /**\n * Issues a FHIR request to get all the meds data for a list of\n * RxNorm codes (medications).\n */\n getLineGraphDataForMedicationDetail(\n rxNorms: RxNormCodeGroup, dateRange: Interval): Promise {\n return rxNorms.getResourceSet(dateRange)\n .then(rxNs => {\n const medOrders: MedicationOrder[] =\n [].concat(...rxNs.map(rx => rx.orders.resourceList));\n return medOrders.map(\n order => order.setMedicationAdministrations(this.fhirService));\n })\n .then(orders => {\n return Promise.all(orders);\n })\n .then(orders => {\n return LineGraphData.fromMedicationOrderSet(\n new MedicationOrderSet(orders), dateRange, this.sanitizer,\n this.encounters);\n });\n }\n\n /**\n * Gets the x regions from the data for this axis.\n */\n getXRegions(): Promise {\n return this.getDataFromFhir(this.dateRange).then(data => {\n return data.xRegions ? data.xRegions : [];\n });\n }\n\n /**\n * Returns whether there's resolved data for this axis.\n */\n dataResolved(): boolean {\n return this.alreadyResolvedData ? true : false;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport * as Color from 'color';\nimport {DateTime} from 'luxon';\n\n/*\n * This class makes an annotation for a particular timestamp with custom notes.\n */\nexport class CustomizableGraphAnnotation {\n // Whether or not the full annotation is shown. If false, only the title of\n // the annotation will show.\n private showDetails: boolean;\n // The width of the annotation.\n readonly annotationWidth = 100;\n // The default height of the annotation.\n readonly annotationHeight = 25;\n // The default y position of the annotation.\n readonly annotationDefaultY = 20;\n\n timestamp: DateTime;\n deleteIcon: HTMLElement;\n editIcon: HTMLElement;\n expandIcon: HTMLElement;\n\n constructor(\n timestamp: DateTime,\n /** The title that will show up in the annotation. */\n readonly title = '',\n /** The description that will show up in the annotation. */\n readonly description = '',\n /** The color for this annotation and associated point. */\n readonly color: Color = Color.rgb('black'),\n /** The timestamp for the annotation */\n ) {\n this.timestamp = timestamp;\n }\n\n addAnnotation(chartDivId: string, differenceInHeight: number): HTMLElement {\n const self = this;\n this.showDetails = false;\n const millis = this.timestamp.toMillis();\n\n const tooltipContainer = document.createElement('div');\n tooltipContainer.setAttribute(\n 'class', 'tooltip-custom-' + chartDivId + millis);\n tooltipContainer.style.left = '0px';\n tooltipContainer.style.borderColor = 'grey';\n tooltipContainer.style.backgroundColor = this.color.toString();\n tooltipContainer.style.bottom =\n (this.annotationDefaultY + differenceInHeight) + 'px';\n\n const tooltipTitleContainer = document.createElement('div');\n tooltipContainer.appendChild(tooltipTitleContainer);\n\n this.expandIcon =\n this.makeIcon('expand-' + chartDivId + millis, 'expand_more');\n this.expandIcon.style.cursor = 'pointer';\n tooltipTitleContainer.appendChild(this.expandIcon);\n\n const tooltipTitle = document.createElement('h6');\n tooltipTitle.setAttribute(\n 'class', 'tooltip-title-custom-' + chartDivId + millis);\n tooltipTitle.innerText = this.title;\n tooltipTitleContainer.appendChild(tooltipTitle);\n\n\n this.deleteIcon = this.makeIcon('delete-' + chartDivId + millis, 'clear');\n this.deleteIcon.style.cursor = 'pointer';\n tooltipTitleContainer.appendChild(this.deleteIcon);\n\n const tooltipDetails = document.createElement('div');\n tooltipDetails.setAttribute(\n 'class', 'tooltip-details-custom-' + chartDivId + millis);\n tooltipContainer.appendChild(tooltipDetails);\n\n const tooltipDetailsText = document.createElement('div');\n tooltipDetailsText.innerText = this.description;\n tooltipDetailsText.setAttribute(\n 'class', 'tooltip-details-text-' + chartDivId + millis);\n tooltipDetails.appendChild(tooltipDetailsText);\n\n this.editIcon = this.makeIcon('edit-' + chartDivId + millis, 'edit');\n this.editIcon.style.cursor = 'pointer';\n tooltipDetails.appendChild(this.editIcon);\n\n /**\n * Add action handlers.\n */\n tooltipTitle.onclick = ((e: MouseEvent) => {\n // Toggle whether or not the details are shown.\n self.showDetails = !self.showDetails;\n self.showDetailsToggle(\n millis, self.showDetails, tooltipContainer, chartDivId);\n });\n\n this.expandIcon.onclick = ((e: MouseEvent) => {\n // Toggle whether or not the details are shown.\n self.showDetails = !self.showDetails;\n self.showDetailsToggle(\n millis, self.showDetails, tooltipContainer, chartDivId);\n });\n\n\n tooltipContainer.onmouseover = (e: MouseEvent) => {\n this.expandIcon.style.visibility = 'visible';\n this.deleteIcon.classList.add('showIcon');\n this.editIcon.classList.add('showIcon');\n };\n\n tooltipContainer.onmouseout = (e: MouseEvent) => {\n this.expandIcon.style.visibility = 'hidden';\n this.deleteIcon.classList.remove('showIcon');\n this.editIcon.classList.remove('showIcon');\n };\n return tooltipContainer;\n }\n\n removeAnnotation(chartDivId: string) {\n const annotation = document.getElementsByClassName(\n 'tooltip-whole-' + chartDivId + this.timestamp.toMillis())[0];\n const parent = annotation.parentNode;\n if (parent) {\n parent.removeChild(annotation);\n }\n }\n\n private makeIcon(id: string, iconName: string): HTMLElement {\n const icon = document.createElement('i');\n icon.setAttribute('class', 'material-icons');\n icon.setAttribute('id', id);\n icon.style.fontSize = '18px';\n icon.innerHTML = iconName;\n return icon;\n }\n // Toggles whether or not the full annotation is shown.\n private showDetailsToggle(\n millis: number, toggle: boolean, element: any, chartDivId: string) {\n const detailsElement =\n document.getElementsByClassName(\n 'tooltip-details-custom-' + chartDivId + millis)[0] as HTMLElement;\n const expandElement =\n document.getElementById('expand-' + chartDivId + millis);\n if (toggle) {\n detailsElement.style.display = 'inline-block';\n expandElement.innerHTML = 'expand_less';\n } else {\n detailsElement.style.display = 'none';\n expandElement.innerHTML = 'expand_more';\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, forwardRef, Inject, Input, OnChanges, OnDestroy, Output, SimpleChanges} from '@angular/core';\nimport {MatDialog} from '@angular/material/dialog';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {DateTime, Interval} from 'luxon';\n// tslint:disable-next-line:max-line-length\nimport {CustomizableTimelineDialogComponent} from 'src/app/cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component';\nimport {CustomizableData} from 'src/app/graphdatatypes/customizabledata';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\nimport {recordGoogleAnalyticsEvent} from 'src/constants';\n\nimport {GraphComponent} from '../graph/graph.component';\n\nimport {CustomizableGraphAnnotation} from './customizable-graph-annotation';\n\n@Component({\n selector: 'app-customizable-graph',\n templateUrl: '../graph/graph.component.html',\n styleUrls: [\n '../../cardtypes/customizable-timeline/customizable-timeline.component.css'\n ],\n providers: [{\n provide: GraphComponent,\n useExisting: forwardRef(() => CustomizableGraphComponent)\n }]\n})\nexport class CustomizableGraphComponent extends\n GraphComponent implements OnChanges, OnDestroy {\n /**\n * An event indicating that the points on the CustomizableGraph have changed.\n */\n @Output() pointsChanged = new EventEmitter();\n /**\n * Holds whether this graph is in edit mode.\n */\n @Input() inEditMode: boolean;\n\n /**\n * The reference for the Dialog opened.\n */\n private dialogRef: any;\n\n\n constructor(\n readonly sanitizer: DomSanitizer, public dialog: MatDialog,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n this.chartTypeString = 'scatter';\n }\n\n ngOnDestroy() {\n if (this.dialogRef && this.dialogRef.unsubscribe) {\n // Destroy the dialog ref to prevent memory leaks.\n this.dialogRef.unsubscribe();\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n super.ngOnChanges(changes);\n if (changes.dateRange) {\n // CustomizableGraph needs to update annotations in the case that the date\n // range is changed.\n this.dateRangeChanged();\n }\n }\n adjustGeneratedChartConfiguration() {\n const self = this;\n this.chartOptions.scales.yAxes[0].display = false;\n this.chartOptions.scales.yAxes[0].ticks.beginAtZero = true;\n this.chartOptions.tooltips = {enabled: false};\n this.chartOptions.hover = {mode: null};\n this.chartOptions.onClick = function(event) {\n if (!self.inEditMode) {\n return;\n }\n const xValueMoment =\n this.scales[GraphComponent.X_AXIS_ID].getValueForPixel(event.offsetX);\n const dateClicked = DateTime.fromJSDate(xValueMoment.toDate());\n const currentInterval = Interval.fromDateTimes(\n self.dateRange.start.toLocal().startOf('day'),\n self.dateRange.end.toLocal().endOf('day'));\n if (currentInterval.contains(dateClicked)) {\n self.openDialog(dateClicked);\n }\n };\n this.chartOptions.onHover = function(event) {\n if (!self.inEditMode) {\n return;\n }\n const chart: any = this;\n const yScale = chart.scales[GraphComponent.Y_AXIS_ID];\n const xScale = chart.scales[GraphComponent.X_AXIS_ID];\n const currentDate =\n DateTime.fromJSDate(xScale.getValueForPixel(event.offsetX).toDate());\n const currentDateString = currentDate.toLocaleString() + ' ' +\n currentDate.toLocal().toLocaleString(DateTime.TIME_24_SIMPLE);\n\n const currentInterval = Interval.fromDateTimes(\n self.dateRange.start.toLocal().startOf('day'),\n self.dateRange.end.toLocal().endOf('day'));\n\n // Remove all other ctx lines drawn, to only show one hover line.\n chart.clear();\n chart.draw();\n\n // Only display the hover line if the date it represents is within the\n // current date range. This is because the chart is slightly larger than\n // the area contained within the axes, and a line could potentially be\n // shown before the x-axis starts, or after it ends.\n if (currentInterval.contains(currentDate)) {\n chart.ctx.beginPath();\n chart.ctx.moveTo(event.offsetX, 0);\n chart.ctx.strokeStyle = '#A0A0A0';\n chart.ctx.lineTo(event.offsetX, yScale.bottom);\n chart.ctx.stroke();\n chart.ctx.fillText(currentDateString, event.offsetX, yScale.bottom / 2);\n }\n };\n this.chartOptions.animation = {\n onComplete: function(chart) {\n self.removeAnnotations();\n self.addAnnotations();\n }\n };\n }\n\n dateRangeChanged() {\n this.reloadChart();\n this.adjustGeneratedChartConfiguration();\n }\n\n addAnnotations() {\n for (const dataPt of this.chartData[0].data) {\n const canvas = document.getElementById(this.chartDivId);\n const millis = DateTime.fromISO(dataPt['x']).toMillis();\n const annotation = this.data.annotations.get(millis);\n const color = annotation.color ? annotation.color : '#000000';\n // We need to cast this.chart.chart as any so we can access the 'scales'\n // property.\n const xOffset = (this.chart.chart as any)\n .scales[GraphComponent.X_AXIS_ID]\n .getPixelForValue(annotation.timestamp.toJSDate());\n const yOffset = (this.chart.chart as any)\n .scales[GraphComponent.Y_AXIS_ID]\n .margins['bottom'];\n const yAxisHeight =\n (this.chart.chart as any).scales[GraphComponent.Y_AXIS_ID].height;\n const heightToUse =\n this.findBestYCoordinate(xOffset, yAxisHeight, yOffset);\n const difference = heightToUse - yOffset;\n\n // Only display the flag if the date it represents is within the\n // current date range. This is so that the flag is not added to a location\n // on the DOM that is not within the chart.\n if (this.entireInterval.contains(DateTime.fromMillis(millis).toLocal())) {\n const tooltip = this.findOrCreateTooltipElement(\n canvas, 'annotation-' + this.chartDivId + millis);\n tooltip.setAttribute(\n 'class', 'tooltip-whole-' + this.chartDivId + millis);\n tooltip.style.borderLeftColor = color;\n tooltip.style.bottom = yOffset + 'px';\n tooltip.style.left = xOffset + 'px';\n tooltip.style.height = heightToUse + 'px';\n while (tooltip.firstChild) {\n tooltip.removeChild(tooltip.firstChild);\n }\n tooltip.onclick = (e: MouseEvent) => {\n const parent = tooltip.parentNode;\n try {\n parent.appendChild(tooltip);\n } catch (e) {\n console.log(e);\n }\n };\n\n tooltip.appendChild(\n annotation.addAnnotation(this.chartDivId, difference));\n this.addDeleteEvent(annotation);\n this.addEditListener(annotation);\n }\n }\n }\n\n private removeAnnotations() {\n const selector = 'tooltip-whole-' + this.chartDivId;\n for (const annotation of Array.from(\n document.querySelectorAll('[class*=' + selector + ']'))) {\n const parent = annotation.parentNode;\n if (parent) {\n parent.removeChild(annotation);\n }\n }\n }\n\n private findBestYCoordinate(\n xOffset: number, yAxisHeight: number, yOffset: number): number {\n const annotationWidth = 100;\n const verticalOverlap = 10;\n const horizontalOverlap = 20;\n const selector = 'tooltip-whole-' + this.chartDivId;\n const allFlags =\n Array.from(document.querySelectorAll('[class*=' + selector + ']'));\n const positions = allFlags.map(flag => {\n const htmlFlag = flag as HTMLElement;\n return {\n left: Number(htmlFlag.style.left.replace('px', '')),\n height: Number(htmlFlag.style.height.replace('px', '')),\n };\n });\n const overlappingYs = [];\n // Check if there are any annotations with horizontal overlap.\n for (const position of positions) {\n const leftPosition = position.left + annotationWidth;\n if (xOffset <= leftPosition &&\n (xOffset + annotationWidth >= position.left)) {\n overlappingYs.push(position.height);\n }\n }\n\n // Figure out the new y-coordinate for the annotation.\n let heightToUse = yOffset;\n // Sort all heights in increasing order.\n overlappingYs.sort(function(a, b) {\n return a - b;\n });\n // By default, try putting the new box above all other annotations with\n // horizontal overlap.\n if (overlappingYs.length > 0) {\n const currentMaxHeight = overlappingYs[overlappingYs.length - 1];\n // Only add height if the annotation does not go past the y axis height.\n if (currentMaxHeight + verticalOverlap <= yAxisHeight) {\n heightToUse = currentMaxHeight + verticalOverlap;\n } else {\n heightToUse = currentMaxHeight;\n }\n }\n // Check if there is any position with space available between existing\n // annotations.\n for (let i = 0; i < overlappingYs.length; i++) {\n // Check if there is enough space.\n if (overlappingYs[i + 1] - (overlappingYs[i] + annotationWidth) >=\n horizontalOverlap) {\n heightToUse = overlappingYs[i];\n }\n }\n return heightToUse;\n }\n\n // If the selected date already has an annotation, modify the time\n // by + 1 millisecond.\n private updateTime(millis: number) {\n if (this.data.annotations.has(millis)) {\n return this.updateTime(millis + 1);\n }\n return millis;\n }\n\n /**\n * Allow for the addition of a point to the CustomizableGraph, via a\n * CustomizableTimelineDialog.\n * (Visible only for testing.)\n */\n addPoint(timestamp: DateTime) {\n if (this.inEditMode) {\n this.dialogRef = this.openDialog(timestamp);\n }\n }\n\n private openDialog(\n timestamp: DateTime, editedAnnotation?: CustomizableGraphAnnotation) {\n // Make the dialog show up near where the user clicked.\n const data = editedAnnotation ? {\n title: editedAnnotation.title,\n date: new Date(editedAnnotation.timestamp.toMillis()),\n description: editedAnnotation.description,\n color: editedAnnotation.color,\n dateRange: this.dateRange,\n } :\n {\n date: timestamp,\n dateRange: this.dateRange,\n };\n\n this.dialogRef =\n this.dialog.open(CustomizableTimelineDialogComponent, {data: data});\n this.dialogRef.afterClosed().subscribe(r => {\n if (r) {\n if (editedAnnotation) {\n this.data.removePointFromSeries(\n DateTime.fromMillis(editedAnnotation.timestamp.toMillis()));\n editedAnnotation.removeAnnotation(this.chartDivId);\n }\n\n const result: CustomizableGraphAnnotation =\n r as CustomizableGraphAnnotation;\n // By default, the user selected date is the original date\n // corresponding to where the user chose to add the point.\n let userSelectedDate = result.timestamp;\n userSelectedDate =\n DateTime.fromMillis(this.updateTime(userSelectedDate.toMillis()));\n result.timestamp = userSelectedDate;\n this.data.addPointToSeries(result);\n this.pointsChanged.emit(this.data);\n this.generateChart();\n\n recordGoogleAnalyticsEvent(\n 'addEventCustomTimeline', 'customTimeline',\n new Date().toDateString());\n }\n });\n }\n\n /**\n * Add a listener for a click event on the delete button of the annotation at\n * the given time.\n * @param annotation The annotation for this point to remove.\n */\n private addDeleteEvent(annotation: CustomizableGraphAnnotation) {\n annotation.deleteIcon.onclick = ((e: MouseEvent) => {\n this.data.removePointFromSeries(annotation.timestamp);\n annotation.removeAnnotation(this.chartDivId);\n this.pointsChanged.emit(this.data);\n this.generateChart();\n });\n }\n\n /**\n * Add a listener for a click event on the edit button of the annotation at\n * the given time.\n * Visible only for testing.\n * @param annotation The annotation for the point to edit.\n */\n addEditListener(annotation: CustomizableGraphAnnotation) {\n annotation.editIcon.onclick = ((e: MouseEvent) => {\n this.dialogRef = this.openDialog(annotation.timestamp, annotation);\n\n recordGoogleAnalyticsEvent(\n 'editEventCustomTimeline', 'customTimeline',\n new Date().toDateString());\n });\n }\n}\n","module.exports = \"::ng-deep canvas {\\n -moz-user-select: none;\\n -webkit-user-select: none;\\n -ms-user-select: none;\\n cursor: pointer;\\n}\\n::ng-deep .chartjs-tooltip {\\n opacity: 1;\\n position: absolute;\\n pointer-events: none;\\n /* Show the tooltip above everything else. */\\n z-index: 1000;\\n}\\n::ng-deep .chartjs-tooltip-key {\\n display: inline-block;\\n width: 10px;\\n height: 10px;\\n margin-right: 10px;\\n}\\n/* All the below styles apply to elements within the graphs. Because these\\nare nested inside the components and within C3 divs, we have to prefix the\\nstyle names with ::ng-deep. */\\n::ng-deep .c3-tooltip {\\n font-size: 13px;\\n border-collapse: collapse;\\n border-spacing: 0;\\n background-color: #fff;\\n empty-cells: show;\\n box-shadow: 7px 7px 12px -9px #777777;\\n opacity: 0.9;\\n}\\n::ng-deep table {\\n background: #fff;\\n border: solid 1px #ddd;\\n}\\n::ng-deep .c3-tooltip tr {\\n border: 1px solid #CCC;\\n}\\n::ng-deep .c3-tooltip > tbody > tr > th {\\n width: 100%;\\n word-wrap: break-word;\\n background-color: #aaa;\\n font-size: 14px;\\n padding: 2px 5px;\\n text-align: left;\\n color: #FFF;\\n}\\n::ng-deep .c3-tooltip td {\\n width: 125px;\\n font-size: 13px;\\n padding: 3px 6px;\\n background-color: #fff;\\n border-left: 1px dotted #999;\\n}\\n::ng-deep .order-region {\\n fill: rgb(179, 157, 219); /* Secondary color */\\n stroke: rgb(179, 157, 219); /* Secondary color */\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvZ3JhcGh0eXBlcy9ncmFwaC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxzQkFBc0I7RUFDdEIseUJBQXlCO0VBQ3pCLHFCQUFxQjtFQUNyQixlQUFlO0FBQ2pCO0FBQ0E7RUFDRSxVQUFVO0VBQ1Ysa0JBQWtCO0VBQ2xCLG9CQUFvQjtFQUNwQiw0Q0FBNEM7RUFDNUMsYUFBYTtBQUNmO0FBRUE7RUFDRSxxQkFBcUI7RUFDckIsV0FBVztFQUNYLFlBQVk7RUFDWixrQkFBa0I7QUFDcEI7QUFFQTs7OEJBRThCO0FBRTlCO0VBQ0UsZUFBZTtFQUNmLHlCQUF5QjtFQUN6QixpQkFBaUI7RUFDakIsc0JBQXNCO0VBQ3RCLGlCQUFpQjtFQUdqQixxQ0FBcUM7RUFDckMsWUFBWTtBQUNkO0FBRUE7RUFDRSxnQkFBZ0I7RUFDaEIsc0JBQXNCO0FBQ3hCO0FBRUE7RUFDRSxzQkFBc0I7QUFDeEI7QUFFQTtFQUNFLFdBQVc7RUFDWCxxQkFBcUI7RUFDckIsc0JBQXNCO0VBQ3RCLGVBQWU7RUFDZixnQkFBZ0I7RUFDaEIsZ0JBQWdCO0VBQ2hCLFdBQVc7QUFDYjtBQUVBO0VBQ0UsWUFBWTtFQUNaLGVBQWU7RUFDZixnQkFBZ0I7RUFDaEIsc0JBQXNCO0VBQ3RCLDRCQUE0QjtBQUM5QjtBQUVBO0VBQ0Usd0JBQXdCLEVBQUUsb0JBQW9CO0VBQzlDLDJCQUEyQixFQUFFLG9CQUFvQjtBQUNuRCI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Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Inject, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {Chart, ChartDataSets, ChartOptions, ChartXAxe, ChartYAxe} from 'chart.js';\nimport * as pluginAnnotations from 'chartjs-plugin-annotation';\nimport {DateTime, Interval} from 'luxon';\nimport {BaseChartDirective, Color} from 'ng2-charts';\nimport {GraphData} from 'src/app/graphdatatypes/graphdata';\nimport {LabeledSeries} from 'src/app/graphdatatypes/labeled-series';\nimport {LineGraphData} from 'src/app/graphdatatypes/linegraphdata';\nimport {UI_CONSTANTS, UI_CONSTANTS_TOKEN} from 'src/constants';\nimport {v4 as uuid} from 'uuid';\n\nimport {StandardTooltip} from '../tooltips/tooltip';\n\nexport enum ChartType {\n SCATTER,\n LINE,\n STEP,\n MICROBIO\n}\n\n/**\n * Displays a graph. T is the data type the graph is equipped to display.\n */\nexport abstract class GraphComponent implements OnInit,\n OnChanges {\n /** Dummy data series label. */\n private static readonly DEFAULT_BLANK_DATA_LABEL = 'blankdatalabel';\n\n /**\n * The amount of padding to add to the left of the graph. This goes hand in\n * hand with how we choose to wrap the labels in the rendered chart, so if\n * Y_AXIS_TICK_MAX changes, this probably needs to change, too.\n */\n private static readonly Y_AXIS_LEFT_PADDING = 125;\n\n /** Line weights for emphasized and non-emphasized line graphs. */\n private static readonly THICK_LINE = 3;\n private static readonly THIN_LINE = 1;\n\n /** Constants for x and y axis names. */\n static readonly Y_AXIS_ID = 'y-axis-0';\n static readonly X_AXIS_ID = 'x-axis-0';\n\n /** The base chart height to use when rendering. */\n readonly BASE_CHART_HEIGHT_PX = 150;\n\n /**\n * The entire interval represented by the current date range. This Interval\n * goes from the beginning of the first day of the date range, to the end of\n * the last day of the date range.\n */\n protected entireInterval: Interval;\n\n /** Whether data is available for this graph for the current date range. */\n private dataPointsInDateRange = false;\n\n /*****************************************\n * Bound input variables\n */\n\n /** The x-axis eventlines to display on the chart. */\n @Input() eventlines: Array<{[key: string]: number | string}>;\n /** The x-axis to use for the chart. */\n @Input() dateRange: Interval;\n /** The y-axis label to display. */\n @Input() axisLabel: string;\n /** The graph data to show. */\n @Input() data: T;\n /** The x regions to mark on this graph. */\n @Input() xRegions: Array<[DateTime, DateTime]>;\n\n /*****************************************\n * Variables the chart.js directive binds to.\n */\n\n @ViewChild(BaseChartDirective) chart: BaseChartDirective;\n /** Plugins for chart.js. */\n chartPlugins = [pluginAnnotations];\n\n // The bindings are unhappy when you provide an empty data array, so we\n // give it a fake series to render.\n /**\n * The chart data sets to render.\n */\n chartData: ChartDataSets[] = [\n {data: [], label: GraphComponent.DEFAULT_BLANK_DATA_LABEL},\n ];\n\n /**\n * Chart options to be rendered.\n */\n readonly chartOptions: (ChartOptions&{annotation: any}) = {\n // Draw straight lines between points instead of curves.\n elements: {line: {tension: 0}},\n layout: {padding: {top: 15}},\n // We make our own legend so we don't show the built-in one.\n legend: {display: false},\n scales: {xAxes: [this.generateXAxis()], yAxes: [this.generateYAxis()]},\n // Needed to grow the graph to fit the space.\n responsive: true,\n maintainAspectRatio: false,\n // Set up the custom callback for the tooltips.\n tooltips: {\n enabled: false,\n position: 'nearest',\n /**\n * Sets the tooltip for the graph.\n * If the class has a tooltipMap set, then we look up the tooltip from\n * that map. If there's no tooltipMap, then we return a simple formatted\n * tooltip of just the string representing the data plus the appropriate\n * units for a linegraph, or just the unedited value if it's a different\n * kind of graph.\n */\n custom:\n (tooltipContext) => {\n // Get, or construct, a tooltip element to put all the tooltip HTML\n // into.\n const canvas = document.getElementById(this.chartDivId);\n const tooltipEl = this.findOrCreateTooltipElement(\n canvas, 'chartjs-tooltip' + this.chartDivId);\n\n // Hide the element if there is no tooltip-- this function gets\n // called back whether you're hovering over an element or not.\n if (tooltipContext.opacity === 0) {\n tooltipEl.style.opacity = '0';\n return;\n }\n\n if (tooltipContext.body) {\n tooltipEl.innerHTML = this.getTooltipInnerHtml(tooltipContext);\n }\n\n // Display the tooltip lined up with the data point.\n const positionY = canvas.offsetTop;\n const positionX = canvas.offsetLeft;\n tooltipEl.style.opacity = '1';\n tooltipEl.style.left = positionX + tooltipContext.caretX + 'px';\n tooltipEl.style.top = positionY + tooltipContext.caretY + 'px';\n }\n },\n annotation: {\n // Array of annotation configuration objects to be filled in.\n annotations: []\n },\n // Disable any visual changes on hovering.\n hover: {mode: null},\n /** The settings below are just for better performance. */\n animation: {duration: 0},\n responsiveAnimationDuration: 0\n };\n\n /** A unique identifier for the element to bind the graph to. */\n chartDivId: string;\n\n /**\n * The default chart type for this chart. The Angular directive binds\n * to this string to tell chart.js which chart type to use.\n */\n chartTypeString = 'line';\n\n constructor(\n readonly sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n // Generate a unique ID for this chart.\n const chartId = uuid();\n // Replace the dashes in the UUID to meet HTML requirements.\n const re = /\\-/gi;\n this.chartDivId = 'chart' + chartId.replace(re, '');\n }\n\n ngOnInit() {\n this.generateChart();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.eventlines) {\n this.updateEventlines(changes.eventlines.currentValue);\n }\n if (changes.dateRange) {\n this.chartOptions.scales.xAxes = [this.generateXAxis()];\n this.entireInterval = Interval.fromDateTimes(\n this.dateRange.start.toLocal().startOf('day'),\n this.dateRange.end.toLocal().endOf('day'));\n }\n if (changes.xRegions) {\n this.showXRegions();\n }\n }\n\n /**\n * When the component gets initialized and upon updates, this series of calls\n * modifies the data-bound variables so that the correct chart gets rendered.\n *\n * 1) prepareForChartConfiguration: an overrideable function in which\n * subclasses can get things ready for the chart to load in data\n * 2) generateBasicChart: load in the chart data and do formatting that all\n * subclasses share in common\n * 3) adjustGeneratedChartConfiguration: make any tweaks to the chart\n * that couldn't be made until the data got loaded in\n */\n\n generateChart(focusOnSeries?: LabeledSeries[]) {\n if (this.data && this.dateRange) {\n this.chartData =\n [{data: [], label: GraphComponent.DEFAULT_BLANK_DATA_LABEL}];\n this.entireInterval = Interval.fromDateTimes(\n this.dateRange.start.toLocal().startOf('day'),\n this.dateRange.end.toLocal().endOf('day'));\n this.dataPointsInDateRange = this.data.dataPointsInRange(this.dateRange);\n this.prepareForChartConfiguration();\n this.generateBasicChart(focusOnSeries);\n this.adjustGeneratedChartConfiguration();\n }\n }\n\n updateEventlines(eventlines: Array<{[key: string]: number | string}>) {\n const currentInterval = Interval.fromDateTimes(\n this.dateRange.start.toLocal().startOf('day'),\n this.dateRange.end.toLocal().endOf('day'));\n this.chartOptions.annotation.annotations =\n this.chartOptions.annotation.annotations.filter(\n a => !(a.id && a.id.includes('eventline')));\n if (this.chart) {\n for (const eventline of eventlines) {\n const currentDate = DateTime.fromMillis(Number(eventline.value));\n if (currentInterval.contains(currentDate)) {\n const line = {\n type: 'line',\n mode: 'vertical',\n id: 'eventline' + eventline.value,\n scaleID: GraphComponent.X_AXIS_ID,\n value: currentDate.toJSDate(),\n borderColor: eventline.color,\n borderWidth: 2,\n };\n this.chartOptions.annotation.annotations.push(line);\n }\n }\n this.reloadChart();\n }\n }\n\n reloadChart() {\n if (this.chart !== undefined && this.chart.chart !== undefined) {\n this.chart.chart.destroy();\n\n this.chart.datasets = this.chartData;\n this.chart.options = this.chartOptions;\n this.chart.ngOnInit();\n }\n }\n\n /**\n * Lines up any extra things needed to generate the\n * chart. Override this function when you need to make changes before the data\n * is loaded into the chart or when you need to load more data into the chart.\n */\n prepareForChartConfiguration() {}\n\n /**\n * Tweaks the generated chart. Override this function when you need to make\n * changes based on the data loaded into the chart.\n */\n adjustGeneratedChartConfiguration() {}\n\n /**\n * Sets up a generalized c3.ChartConfig for the data passed in. See\n * the type definition at:\n * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/c3/index.d.ts\n */\n private generateBasicChart(focusOnSeries?: LabeledSeries[]) {\n // Transform the data into a format that chart.js can render it.\n Chart.defaults.global.defaultFontFamily = 'Work Sans';\n const data = [];\n for (const series of this.data.series) {\n let lineWidth: number = GraphComponent.THIN_LINE;\n if (focusOnSeries !== undefined && focusOnSeries.includes(series)) {\n lineWidth = GraphComponent.THICK_LINE;\n }\n if (series.coordinates.length > 0) {\n data.push({\n data: series.coordinates.map(pt => {\n return {x: pt[0].toISO(), y: pt[1]};\n }),\n label: series.label,\n // Do not fill the area under the line.\n fill: false,\n borderWidth: lineWidth,\n pointBorderWidth: 2,\n pointRadius: 3,\n backgroundColor: series.legendInfo.fill,\n borderColor: series.legendInfo.fill,\n pointBackgroundColor: series.legendInfo.fill,\n pointBorderColor: series.legendInfo.outline,\n });\n }\n }\n\n // The subclasses may have already put series in lineChartData, and\n // we don't want to remove them, so we just append them to the\n // series. On the other hand, if there's a blank series in\n // lineChartData, we want to get rid of it before putting everything\n // else in.\n if (data.length > 0 && this.onlyDefaultDataPresent()) {\n this.chartData = data;\n } else {\n this.chartData = this.chartData.concat(data);\n }\n\n // Set the axis label if it's provided.\n this.chartOptions.scales.yAxes[0].scaleLabel.labelString = this.axisLabel ?\n this.axisLabel.substr(0, 10) +\n (this.axisLabel.length > 10 ? '...' : '') :\n '';\n\n // Add left-padding so that the y-axes are aligned with one another.\n this.chartOptions.scales.yAxes[0]['afterSetDimensions'] = function(axes) {\n axes.paddingLeft = GraphComponent.Y_AXIS_LEFT_PADDING;\n };\n\n const self = this;\n this.chartOptions.animation.onComplete = function(chart) {\n self.showNoDataLabel(this);\n };\n }\n\n private showXRegions() {\n if (!this.xRegions) {\n return;\n }\n for (const region of this.xRegions) {\n const annotation = {\n // Show the region underneath the data points.\n drawTime: 'beforeDatasetsDraw',\n type: 'box',\n xMin: region[0].toMillis(),\n xMax: region[1].toMillis(),\n xScaleID: GraphComponent.X_AXIS_ID,\n yScaleID: GraphComponent.Y_AXIS_ID,\n backgroundColor: 'rgba(179, 157, 219, 0.3)', // purple secondary color\n borderColor: 'rgba(179, 157, 219, 0.4)', // purple secondary color\n borderWidth: 1,\n };\n this.chartOptions.annotation.annotations.push(annotation);\n }\n this.reloadChart();\n }\n\n showNoDataLabel(chart: any) {\n if (!this.dataPointsInDateRange) {\n // Remove all other ctx objects drawn.\n chart.clear();\n chart.draw();\n\n const xCoordinate = chart.width / 2;\n const yCoordinate = chart.height / 2;\n chart.ctx.textAlign = 'center';\n chart.ctx.fillText(\n UI_CONSTANTS.NO_DATA_AVAILABLE_TMPL +\n this.entireInterval.start.toLocal().toLocaleString() + ' and ' +\n this.entireInterval.end.toLocal().toLocaleString(),\n xCoordinate, yCoordinate);\n }\n }\n\n protected onlyDefaultDataPresent() {\n return this.chartData.length === 1 &&\n this.chartData[0].label === GraphComponent.DEFAULT_BLANK_DATA_LABEL;\n }\n\n /***************************\n * Legend interactions\n */\n\n resetChart() {\n this.generateChart();\n }\n\n focusOnSeries(labeledSeries: LabeledSeries[]) {\n this.generateChart(labeledSeries);\n }\n\n /******************************\n * Helper functions for tooltipping\n */\n\n /**\n * Finds or creates a HTML element to render the tooltip onto.\n * @param canvas The Canvas this graph is rendered on\n * @param uniqueId The unique ID to give to this element. If not provided,\n * will use 'chartjs-tooltip' + the chart div ID.\n */\n protected findOrCreateTooltipElement(canvas: HTMLElement, uniqueId: string):\n HTMLElement {\n const tooltipTag =\n uniqueId ? uniqueId : 'chartjs-tooltip' + this.chartDivId;\n let tooltipEl = document.getElementById(tooltipTag);\n if (!tooltipEl) {\n tooltipEl = document.createElement('div');\n tooltipEl.id = tooltipTag;\n tooltipEl.classList.add('chartjs-tooltip');\n tooltipEl.innerHTML = '
';\n canvas.parentNode.appendChild(tooltipEl);\n }\n return tooltipEl;\n }\n\n /**\n * Gets the tooltip text for the given context.\n * @param tooltipContext The tooltip context passed into the tooltip\n * callback\n */\n private getTooltipInnerHtml(tooltipContext: any): string {\n // We squish together all points at the same timestamp preemptively\n // in our tooltip creation so that we just find the index of the\n // tooltip based on the first point's x-value.\n const xValue = tooltipContext.dataPoints[0].label;\n\n const timestampKey = DateTime.fromISO(xValue).toMillis().toString();\n // Our data class may provide a tooltip key function that will\n // get the correct identifier from the data point. If it does,\n // we'll use that, but by default, the key is the timestamp\n // of the data point.\n const keyToUse = this.data.tooltipKeyFn ?\n this.data.tooltipKeyFn(tooltipContext) :\n timestampKey;\n\n // If something bad happens and we don't have a tooltip for the\n // key, return a generic tooltip with the value.\n let tooltipText;\n if (!this.data.tooltipMap || !this.data.tooltipMap.has(keyToUse)) {\n tooltipText =\n new StandardTooltip(\n [], undefined,\n this.data instanceof LineGraphData ? this.data.unit : '')\n .getTooltip(undefined, this.sanitizer);\n } else {\n tooltipText = this.data.tooltipMap.get(keyToUse);\n }\n return tooltipText;\n }\n\n /*************************\n * Helper functions for other chart options\n */\n protected generateXAxis(): ChartXAxe {\n return {\n id: GraphComponent.X_AXIS_ID,\n type: 'time',\n gridLines: {display: true, drawOnChartArea: false},\n time: {\n // This sets the bounds of the x-axis. The default values of 0 and 10\n // are nonsensical but necessary since the graph is first rendered\n // before dateRange is bound.\n min: this.dateRange ? this.dateRange.start.toISO() :\n DateTime.utc().toISO(),\n max: this.dateRange ? this.dateRange.end.toISO() :\n DateTime.utc().toISO(),\n // If we're showing fewer than three days, go for the hour axis labels;\n // otherwise go with by-day axis labels.\n unit: this.dateRange && (this.dateRange.length('day') > 3) ? 'day' :\n 'hour',\n displayFormats: {\n hour: 'MM/DD H:mm',\n day: 'MM/DD',\n }\n },\n ticks: {\n // Only show as many tick labels will fit neatly on the axis.\n autoSkip: true,\n display: true\n },\n scaleLabel: {fontFamily: 'Work Sans'}\n };\n }\n\n private generateYAxis(): ChartYAxe {\n return {\n id: GraphComponent.Y_AXIS_ID,\n position: 'left',\n // Show tick marks but not grid lines.\n gridLines: {display: true, drawOnChartArea: false},\n scaleLabel: {\n display: true,\n labelString: '',\n },\n ticks: {\n // We explicitly set the y values to show, so we don't want to use\n // autoskip.\n autoSkip: false,\n callback: (value, index, values) => {\n if (!this.data) {\n return value;\n }\n return (value).toLocaleString('en-us', {\n minimumFractionDigits: this.data.precision,\n maximumFractionDigits: this.data.precision\n });\n }\n }\n };\n }\n}\n","\n// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nimport * as Color from 'color';\nimport * as Colors from '../theme/verily_colors';\n/**\n * Represents how a concept will be displayed in a legend, with a label, fill\n * color, and outline color.\n */\nexport class LegendInfo {\n private static colorIdx = 0;\n constructor(\n readonly label: string, readonly fill?: Color, readonly outline?: Color) {\n let tempColor: Color = fill;\n if (!fill) {\n tempColor = Colors.getDataColors()[LegendInfo.colorIdx];\n LegendInfo.colorIdx =\n (LegendInfo.colorIdx + 1) % Colors.getDataColors().length;\n }\n this.fill = tempColor;\n this.outline = outline ? outline : tempColor;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, forwardRef, Inject, Input, OnChanges, SimpleChanges} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {ChartPoint} from 'chart.js';\nimport {LabeledSeries} from 'src/app/graphdatatypes/labeled-series';\nimport {LineGraphData} from 'src/app/graphdatatypes/linegraphdata';\nimport {ABNORMAL} from 'src/app/theme/verily_colors';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\nimport {DateTime} from 'luxon';\n\nimport {GraphComponent} from '../graph/graph.component';\n\n@Component({\n selector: 'app-linegraph',\n templateUrl: '../graph/graph.component.html',\n styleUrls: ['../graph.css'],\n providers: [\n {provide: GraphComponent, useExisting: forwardRef(() => LineGraphComponent)}\n ]\n})\nexport class LineGraphComponent extends GraphComponent implements\n OnChanges {\n /**\n * The amount to pad the y-axis around the displayed data range. This gives\n * the data points a little cushion so that they don't run off the top or\n * bottom of the axis.\n */\n static readonly yAxisPaddingFactor = 0.25;\n static readonly NORMAL_BOUND_SERIES_NAME = 'normalBound';\n\n @Input() showTicks: boolean;\n\n private addedNormalBound = false;\n\n constructor(\n readonly sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n super.ngOnChanges(changes);\n }\n\n adjustGeneratedChartConfiguration() {\n // We have to wait until after the data loads up into the graph to iterate\n // over the points and adjust their coloring based on the normal range.\n this.addedNormalBound = this.isNormalBoundAdded(this.data.series);\n this.addYNormalRange();\n\n const seriesLength = this.data.series.length;\n\n if (this.addedNormalBound) {\n // Gives the last labeledSeries in the array a different set of\n // characteristics. The last labeledSeries depicts the normal boundary.\n const chartjsSeries = this.chartData[seriesLength - 1];\n chartjsSeries.pointStyle = 'crossRot';\n chartjsSeries.pointBorderColor = 'rgba(0,0,0,0.5)'; // medium-gray color\n chartjsSeries.pointBorderWidth = 2;\n chartjsSeries.pointRadius = 4;\n chartjsSeries.borderColor = 'transparent';\n }\n\n // Color points that fall outside of their respective normal ranges.\n // If it hasNormalBound, then the last labeledSeries does not need to\n // be styled in this for loop.\n for (let i = 0; i < (this.addedNormalBound ? seriesLength - 1 : seriesLength); i++) {\n const chartjsSeries = this.chartData[i];\n const labeledSeries = this.data.series[i];\n this.colorAbnormalPoints(chartjsSeries, labeledSeries);\n }\n if (!this.showTicks) {\n this.chartOptions.scales.yAxes[0].display = false;\n this.chartOptions.scales.yAxes[0].ticks.beginAtZero = true;\n }\n }\n\n /**\n * Adds y normal ranges to the graph and colors points the designated\n * \"abnormal\" color if they fall outside the normal range.\n */\n private addYNormalRange() {\n // Only LineGraphData has y normal bounds.\n if (!(this.data instanceof LineGraphData)) {\n return;\n }\n\n let normalRangeBounds;\n if (this.data.series.length === 1 || this.addedNormalBound) {\n // Some things are only valid if there are y-axis normal bounds. We\n // also only show normal bounds if there's one data series on the\n // axis, and all normal bounds for the current date range are the same.\n // These customizations are based on this.data, which is a type\n // specific for LineGraphData, and could not be generalized in the\n // abstract GraphCard class.\n let dateTimesInRange = [];\n let firstNormalRange: [number, number];\n if (this.data.series[0].normalRanges) {\n dateTimesInRange = Array.from(this.data.series[0].normalRanges.keys())\n .filter(date => this.dateRange.contains(date));\n firstNormalRange = dateTimesInRange.length > 0 ?\n this.data.series[0].normalRanges.get(dateTimesInRange[0]) :\n undefined;\n }\n if (firstNormalRange) {\n let differentNormalRanges = false;\n for (const time of dateTimesInRange) {\n const currNormalRange = this.data.series[0].normalRanges.get(time);\n if (currNormalRange[0] !== firstNormalRange[0] ||\n currNormalRange[1] !== firstNormalRange[1]) {\n differentNormalRanges = true;\n }\n }\n // If all normal ranges associated with points in the current date\n // range are the same, then add the region to the chart, and adjust\n // display bounds accordingly.\n if (!differentNormalRanges) {\n // To prevent the creation of multiple normal bound tooltips\n if (this.addedNormalBound === false) {\n this.createNormalBoundsTooltip(firstNormalRange);\n }\n this.addGreenRegion(firstNormalRange);\n normalRangeBounds = firstNormalRange;\n this.addedNormalBound = true;\n }\n }\n }\n this.adjustChartYScales(normalRangeBounds);\n }\n\n private adjustChartYScales(normalRangeBounds: [number, number]) {\n const yDisplayBounds = this.getDisplayBounds(normalRangeBounds);\n\n // If the display bounds are enforced and all the bounds are the\n // same, don't pad.\n const padding = (this.allBoundsAreEnforced() && this.allBoundsAreSame()) ?\n 0 :\n Math.abs(yDisplayBounds[1] - yDisplayBounds[0]) *\n LineGraphComponent.yAxisPaddingFactor;\n this.chartOptions.scales.yAxes[0].ticks.min = yDisplayBounds[0] - padding;\n this.chartOptions.scales.yAxes[0].ticks.max = yDisplayBounds[1] + padding;\n this.chartOptions.scales.yAxes[0].afterBuildTicks = (scale) => {\n if (this.data && this.data.yTicks) {\n scale.ticks =\n LineGraphData.getYTicks(yDisplayBounds[0], yDisplayBounds[1]);\n }\n };\n }\n\n /**\n * Helper function that determines whether the LabeledSeries has\n * a normal bound or not.\n * @param series LabeledSeries[] that presents the data that is to\n * be presented in the graph.\n * @returns boolean value that reflects whether there is a normal\n * bound or not.\n */\n private isNormalBoundAdded(series: LabeledSeries[]): boolean {\n for (const s of series) {\n if (s.label === LineGraphComponent.NORMAL_BOUND_SERIES_NAME) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reconciles together several possible sources of y-axis display bounds. The\n * bounds can come from three places:\n * 1) Each ResourceCode has an expected data bound encoded.\n * 2) Each Observation point may have a normal range encoded (passed in as\n * normalRangeBounds only if all the observation points have the same\n * normal range; otherwise normalRangeBounds is undefined).\n * 3) LineGraphData tracks the range of data seen across all data points.\n *\n * Our goal here is to show as much data as possible without being misleading\n * or skewing the graph too much to include outlier points. So, we follow\n * these rules:\n *\n * 1) If all the ResourceCodes have the same expected data bound, and all of\n * them are marked to enforce that bound, choose those upper and lower\n * bounds.\n * 2) Else, consider each endpoint of the bound separately.\n * a. For the lower bound, choose min(min data, min normal bound)\n * b. For the upper bound, choose max(max data, max normal bound)\n */\n private getDisplayBounds(normalRangeBounds: [number, number]):\n [number, number] {\n if (this.allBoundsAreSame() && this.allBoundsAreEnforced()) {\n return this.data.resourceGroup.resourceCodes[0].displayBounds;\n }\n\n if (!normalRangeBounds) {\n return (this.data.yAxisDataBounds);\n }\n\n return [\n Math.min(this.data.yAxisDataBounds[0], normalRangeBounds[0]),\n Math.max(this.data.yAxisDataBounds[1], normalRangeBounds[1])\n ];\n }\n\n private allBoundsAreSame(): boolean {\n if (this.data.resourceGroup) {\n return new Set(\n this.data.resourceGroup.resourceCodes\n .map(code => code.displayBounds)\n .filter(bound => bound !== undefined)\n .map(\n bound =>\n bound.toString() // cast to string for hashability\n ))\n .size === 1;\n }\n return false;\n }\n\n private allBoundsAreEnforced(): boolean {\n if (this.data.resourceGroup) {\n return this.data.resourceGroup.resourceCodes.map(x => x.forceDisplayBounds)\n .every(x => x === true);\n }\n return false;\n }\n\n /**\n * Adds a LabeledSeries that represents the normal bounds on the y-axis\n * to the Tooltip Map.\n * @param yNormalBounds The bounds of the y range considered normal.\n */\n private createNormalBoundsTooltip(yNormalBounds: [number, number]) {\n // TypeScript requires a separate declaration for arrays of tuples.\n let coordinatesLblSeries: [DateTime, number][];\n coordinatesLblSeries = [[this.dateRange.start, yNormalBounds[0]],\n [this.dateRange.start, yNormalBounds[1]]];\n const lblSeries = new LabeledSeries(LineGraphComponent.NORMAL_BOUND_SERIES_NAME,\n coordinatesLblSeries, this.data.unit);\n\n let coordinatesChartPoint: ChartPoint[];\n coordinatesChartPoint = [{x: this.dateRange.start.toISO(), y: yNormalBounds[0]},\n {x: this.dateRange.start.toISO(), y: yNormalBounds[1]}];\n\n if (this.data) {\n this.data.series.push(lblSeries);\n\n // Creates an HTML table for the tooltip text, and adds it to the tooltip\n // map. This was done separately because not all line graphs have normal bounds\n // depicted.\n const tooltipText = '' +\n '
' +\n 'Normal Boundary
' +\n 'Upper: ' + yNormalBounds[1] + ' ' + this.data.unit + '\\n' +\n 'Lower: ' + yNormalBounds[0] + ' ' + this.data.unit +\n '
';\n\n const mapKey = this.dateRange.start.valueOf().toString();\n if (this.data.tooltipMap.has(mapKey)) {\n const value = this.data.tooltipMap.get(mapKey);\n this.data.tooltipMap.set(mapKey, value + tooltipText);\n } else {\n this.data.tooltipMap.set(mapKey, tooltipText);\n }\n }\n this.chartData.push(\n {data : coordinatesChartPoint,\n label : LineGraphComponent.NORMAL_BOUND_SERIES_NAME});\n }\n\n /**\n * Draws a green box spanning the entire x-axis and covering y axis normal\n * range. Also puts descriptive labels at the top and bottom of the range.\n * @param yNormalBounds The bounds of the y range considered normal.\n */\n private addGreenRegion(yNormalBounds: [number, number]) {\n const normalRegionAnnotation = {\n // Show the y-bounds underneath the graph points.\n drawTime: 'beforeDatasetsDraw',\n type: 'box',\n yMin: yNormalBounds[0],\n yMax: yNormalBounds[1],\n // No x-axis bounds so it extends to cover the whole graph.\n xScaleID: GraphComponent.X_AXIS_ID,\n yScaleID: GraphComponent.Y_AXIS_ID,\n // Color the region light green.\n backgroundColor: 'rgba(64, 191, 128, 0.15)',\n };\n this.chartOptions.annotation.annotations.push(normalRegionAnnotation);\n }\n\n /**\n * Colors the point the default series color if it's not abnormal, or outlines\n * with the abnormal color if marked as abnormal.\n *\n * @param series The data series to color points for.\n * @param yNormalBounds The bounds of what should be considered normal.\n * @param seriesLegend The legend info for the series we're working with.\n */\n private colorAbnormalPoints(\n chartjsSeries: any, labeledSeries: LabeledSeries) {\n const pointBackgroundColors = new Array();\n const pointBorderColors = new Array();\n const pointStyle = new Array();\n\n for (let pt of chartjsSeries.data) {\n // pt could also be a number here, so we constrain it to when it's a\n // ChartPoint. For some reason Typescript doesn't like it when we do a\n // test to see if pt is an instanceof ChartPoint so checking for the\n // y-attribute is a workaround.\n pt = pt as ChartPoint;\n const inAbnormalSet = labeledSeries.abnormalCoordinates.has(pt.x);\n\n if (inAbnormalSet) {\n pointBackgroundColors.push(\n labeledSeries.legendInfo.fill.rgb().string());\n pointBorderColors.push(ABNORMAL.rgb().string());\n pointStyle.push('triangle');\n } else {\n pointBackgroundColors.push(\n labeledSeries.legendInfo.fill.rgb().string());\n pointBorderColors.push(labeledSeries.legendInfo.outline.rgb().string());\n pointStyle.push('circle');\n }\n chartjsSeries.pointBackgroundColor = pointBackgroundColors;\n chartjsSeries.pointBorderColor = pointBorderColors;\n chartjsSeries.pointStyle = pointStyle;\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, forwardRef, Inject} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {ChartPoint} from 'chart.js';\nimport {CHECK_RESULT_CODE} from 'src/app/fhir-data-classes/observation-interpretation-valueset';\nimport {LabeledSeries} from 'src/app/graphdatatypes/labeled-series';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {GraphComponent} from '../graph/graph.component';\nimport {StepGraphComponent} from '../stepgraph/stepgraph.component';\n\n@Component({\n selector: 'app-microbio-graph',\n templateUrl: '../graph/graph.component.html',\n styleUrls: ['../graph.css'],\n providers: [{\n provide: GraphComponent,\n useExisting: forwardRef(() => MicrobioGraphComponent)\n }]\n})\nexport class MicrobioGraphComponent extends StepGraphComponent {\n constructor(\n sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n }\n\n prepareForChartConfiguration() {\n super.prepareForChartConfiguration();\n // Make the points a little bigger for microbio series since there is info\n // encoded in their point styling.\n for (const series of this.chartData) {\n series.pointRadius = 5;\n series.pointBorderWidth = 2;\n }\n }\n\n adjustGeneratedChartConfiguration() {\n // Color points that fall outside of their respective normal ranges.\n for (let i = 0; i < this.data.series.length; i++) {\n const isPositive = this.data.series[i].label.includes(CHECK_RESULT_CODE);\n const chartjsSeries = this.chartData[i];\n const pointStyle = new Array();\n for (let pt of chartjsSeries.data) {\n // pt could also be a number here, so we constrain it to when it's a\n // ChartPoint. For some reason Typescript doesn't like it when we do a\n // test to see if pt is an instanceof ChartPoint so checking for the\n // y-attribute is a workaround.\n pt = pt as ChartPoint;\n if (isPositive) {\n pointStyle.push('triangle');\n } else {\n pointStyle.push('circle');\n }\n (chartjsSeries as any).pointStyle = pointStyle;\n }\n }\n }\n\n /***************************\n * Legend interactions\n * Because of the unique nature of the series in the MicrobioGraph, we do not\n * allow legend interactions for microbiology graphs. This prevents errors\n * that occur when the user hovers over a legend element that might correspond\n * to many series on the chart.\n */\n\n /**\n * @override\n */\n resetChart() {}\n\n /**\n * @override\n */\n focusOnSeries(labeledSeries: LabeledSeries[]) {}\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, forwardRef, Inject} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {GraphComponent} from '../graph/graph.component';\nimport {LineGraphComponent} from '../linegraph/linegraph.component';\n\n@Component({\n selector: 'app-scatterplot',\n templateUrl: '../graph/graph.component.html',\n styleUrls: ['../graph.css'],\n providers: [{\n provide: GraphComponent,\n useExisting: forwardRef(() => ScatterplotComponent)\n }]\n})\nexport class ScatterplotComponent extends LineGraphComponent {\n constructor(\n sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n this.chartTypeString = 'scatter';\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, forwardRef, Inject} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {MicrobioGraphData} from 'src/app/graphdatatypes/microbiographdata';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {StepGraphData} from '../../graphdatatypes/stepgraphdata';\nimport {GraphComponent} from '../graph/graph.component';\n\n@Component({\n selector: 'app-stepgraph',\n templateUrl: '../graph/graph.component.html',\n styleUrls: ['../graph.css'],\n providers: [\n {provide: GraphComponent, useExisting: forwardRef(() => StepGraphComponent)}\n ]\n})\nexport class StepGraphComponent extends\n GraphComponent {\n constructor(\n readonly sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n }\n /**\n * The maximum characters for a y-axis tick label.\n */\n readonly Y_AXIS_TICK_MAX_LENGTH = 12;\n\n /**\n * Adjusts the y-axis configuration for the chart.\n */\n prepareForChartConfiguration() {\n this.chartOptions.scales.yAxes[0].type = 'category';\n this.chartOptions.scales.yAxes[0].gridLines = {\n display: true,\n drawOnChartArea: true\n };\n\n // Set up the data points.\n const yValuesForEndpoints = [];\n for (const series of this.data.series) {\n // Since the categorical labels may be long, we truncate the label names.\n // We also have to re-map the coordinates to the truncated names so\n // that they may be plotted correctly along the categorical axis.\n series.coordinates.forEach(pt => {\n const lbl = pt[1] as string;\n const truncatedLabel = lbl.substr(0, this.Y_AXIS_TICK_MAX_LENGTH) +\n (lbl.length > this.Y_AXIS_TICK_MAX_LENGTH ? '...' : '');\n yValuesForEndpoints.push(truncatedLabel);\n pt[1] = truncatedLabel;\n });\n }\n let allLabels = Array.from(new Set(yValuesForEndpoints));\n // Show the labels alphabetically along the y-axis.\n allLabels = allLabels.sort();\n // Add blank labels to the top and bottom of the graph to add some padding.\n allLabels.push('\\t');\n allLabels.unshift('\\t');\n\n this.chartOptions.scales.yAxes[0]['labels'] = allLabels;\n }\n adjustGeneratedChartConfiguration() {}\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {Duration} from 'luxon';\nimport {AnnotatedAdministration, MedicationAdministration} from 'src/app/fhir-data-classes/medication-administration';\n\nimport {MedicationOrder} from '../../fhir-data-classes/medication-order';\nimport {Tooltip} from '../tooltips/tooltip';\n\n/**\n * Makes a tooltip for a medication order that lists the order's first and last\n * doses in a table.\n */\nexport class MedicationTooltip extends Tooltip {\n getTooltip(order: MedicationOrder, sanitizer: DomSanitizer): string {\n const medication = order.label;\n const firstDose =\n Tooltip.formatTimestamp(order.firstAdministration.timestamp);\n const lastDose =\n Tooltip.formatTimestamp(order.lastAdmininistration.timestamp);\n const dosageInstruction = order.dosageInstruction;\n const table = Tooltip.createNewTable();\n Tooltip.addHeader(medication, table, sanitizer);\n Tooltip.addRow(table, ['First Dose', firstDose], sanitizer);\n Tooltip.addRow(table, ['Last Dose', lastDose], sanitizer);\n Tooltip.addRow(\n table, ['Dosage Instructions', dosageInstruction], sanitizer);\n return table.outerHTML;\n }\n}\n\n/**\n * Makes a tooltip for a medication administration that shows its dose\n * as well as the time since the last dose.\n */\nexport class MedicationAdministrationTooltip extends\n Tooltip {\n getTooltip(\n administrations: AnnotatedAdministration[],\n sanitizer: DomSanitizer): string {\n const timestamp = administrations[0].medAdministration.timestamp;\n const table = Tooltip.createNewTable();\n for (const administration of administrations) {\n Tooltip.addHeader(\n Tooltip.formatTimestamp(timestamp) + ': Dose ' +\n administration.doseInOrder + ' of ' +\n administration.medAdministration.rxNormCode.label,\n table, sanitizer, 3);\n Tooltip.addRow(table, ['', 'Time', 'Dose'], sanitizer);\n Tooltip.addRow(\n table,\n [\n 'This dose',\n Tooltip.formatTimestamp(administration.medAdministration.timestamp),\n this.formatDosage(administration.medAdministration)\n ],\n sanitizer);\n\n if (administration.previousDose) {\n const timestampDifference: Duration =\n administration.medAdministration.timestamp.diff(\n administration.previousDose.medAdministration.timestamp);\n\n const doseDiffText =\n Tooltip.formatTimestamp(\n administration.previousDose.medAdministration.timestamp) +\n '
(' + timestampDifference.toFormat('h:m') + ' after dose ' +\n administration.previousDose.doseInOrder + ')';\n\n Tooltip.addRow(\n table,\n [\n 'Previous dose', doseDiffText,\n this.formatDosage(administration.previousDose.medAdministration)\n ],\n sanitizer);\n }\n }\n return table.outerHTML;\n }\n\n private formatDosage(administration: MedicationAdministration) {\n return administration.dosage.quantity.toLocaleString() + ' ' +\n administration.dosage.unit;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport * as Color from 'color';\n\nimport {AnnotatedDiagnosticReport} from 'src/app/fhir-data-classes/annotated-diagnotic-report';\nimport {DiagnosticReportStatus} from 'src/app/fhir-data-classes/diagnostic-report';\n\nimport {Tooltip} from '../tooltips/tooltip';\n\n/*\n * This class makes a tooltip for a DiagnosticReport that applies to all points\n * charted from the same report. It lists the time of the report, the report\n * status, as well as all results contained in the report.\n */\nexport class MicrobioTooltip extends Tooltip {\n constructor(private addTimestampRow = true, private color?: Color) {\n super();\n }\n\n getTooltip(\n annotatedReport: AnnotatedDiagnosticReport, sanitizer: DomSanitizer,\n isAbnormal: boolean = false): string {\n const status = DiagnosticReportStatus[annotatedReport.report.status];\n const results = annotatedReport.report.results;\n const timestamp = annotatedReport.timestamp;\n const specimen = annotatedReport.report.specimen.type;\n\n const table = Tooltip.createNewTable();\n if (this.addTimestampRow) {\n Tooltip.addTimeHeader(timestamp, table, sanitizer);\n }\n\n Tooltip.addHeader('Result set', table, sanitizer);\n\n for (const result of results) {\n Tooltip.addRow(\n table, [result.display, result.interpretation.display], sanitizer,\n this.color, isAbnormal);\n }\n Tooltip.addRow(table, ['Status', status], sanitizer);\n Tooltip.addRow(table, ['Specimen', specimen], sanitizer);\n\n return table.outerHTML;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport * as Color from 'color';\nimport {DateTime} from 'luxon';\nimport {AnnotatedObservation} from 'src/app/fhir-data-classes/annotated-observation';\nimport {NORMAL} from 'src/app/fhir-data-classes/observation-interpretation-valueset';\n\nimport {Observation} from '../../fhir-data-classes/observation';\n\nimport {Tooltip} from './tooltip';\n\n/*\n * This class makes a tooltip for a list of Observations containing discrete, or\n * qualitative, values rather than quantitative results. The list of\n * Observations should all have the same timestamp.\n */\nexport class DiscreteObservationTooltip extends Tooltip {\n constructor(private addTimestampRow = true) {\n super();\n }\n\n /**\n * Returns the HTML for a generic tooltip for discrete observations.\n * @param observations An array of type Observation\n * @param sanitizer A DOM sanitizer\n * @param isAbnormal A boolean used to change the color of the text if abnormal\n * @returns A string representing the HTML table.\n */\n getTooltip(observations: Observation[], sanitizer: DomSanitizer): string {\n const table = Tooltip.createNewTable();\n if (this.addTimestampRow) {\n Tooltip.addTimeHeader(observations[0].timestamp, table, sanitizer);\n }\n for (const obs of observations) {\n let isAbnormal = false;\n let obsValue = obs.result;\n if (obs.interpretation && obs.interpretation.code !== NORMAL) {\n isAbnormal = true;\n obsValue = obs.result + ' (' + obs.interpretation.display + ')';\n }\n Tooltip.addRow(table,\n [obs.label, obsValue], sanitizer,\n undefined, // color\n isAbnormal);\n }\n return table.outerHTML;\n }\n}\n\n/**\n * Makes a generic tooltip for an AnnotatedObservation with rows for each of\n * its annotation values.\n */\nexport class GenericAnnotatedObservationTooltip extends\n Tooltip {\n constructor(private addTimestampRow: boolean, private color: Color) {\n super();\n }\n\n /**\n * Returns the HTML for a generic tooltip.\n * @param observation The AnnotatedObservation used to generate the tooltip\n * @param sanitizer A DOM sanitizer\n * @param isAbnormal A boolean used to change the color of the text if abnormal\n * @returns If the observation has annotations, a HTML table with the\n * annotation values. If there are no annotations, will return undefined.\n */\n getTooltip(observation: AnnotatedObservation, sanitizer: DomSanitizer, isAbnormal: boolean = false): string\n |undefined {\n const table = Tooltip.createNewTable();\n if (this.addTimestampRow) {\n Tooltip.addTimeHeader(\n observation.observation.timestamp, table, sanitizer);\n }\n\n Tooltip.addRow(\n table,\n [\n observation.label,\n this.getObservationValue(observation)\n ],\n sanitizer, this.color, isAbnormal);\n for (const annotation of observation.annotationValues) {\n Tooltip.addRow(table, annotation, sanitizer);\n }\n return table.outerHTML;\n }\n /**\n * Helper function that returns a string that reflects the observation\n * value depicted on the tooltip.\n * @param observation The AnnotatedObservation used to generate the tooltip\n */\n\n private getObservationValue(observation: AnnotatedObservation): string {\n const interpretation = observation.observation.interpretation ?\n ' (' + observation.observation.interpretation.display + ')' :\n '';\n // Example: Temperature | 38.8 Deg C (HI)\n if (observation.observation.value && observation.observation.unit) {\n return observation.observation.value.value.toString() + ' ' +\n observation.observation.unit + interpretation;\n }\n // Example: Bacteria Urinalysis | Trace Graded/hpf (ABN)\n if (observation.observation.result) {\n return observation.observation.result + interpretation;\n }\n // Example: Blood Pressure | (HI)\n return interpretation;\n }\n}\n\n/**\n * Makes a generic tooltip for an AnnotatedObservation with rows for each of\n * its annotation values.\n */\nexport class GenericAbnormalTooltip extends\n Tooltip<{[key: string]: number | string}> {\n constructor(private addTimestampRow: boolean, private color: Color) {\n super();\n }\n\n /**\n * Returns the HTML for a generic tooltip.\n * @param params The parameters necessary for the AbnormalTooltip text. It\n * should contain a timestamp field, a value field, a label field, and a\n * unit field.\n * @param sanitizer A DOM sanitizer\n * @returns If the observation has annotations, a HTML table with the\n * annotation values. If there are no annotations, will return undefined.\n */\n getTooltip(params: {[key: string]: number|string}, sanitizer: DomSanitizer):\n string|undefined {\n const table = Tooltip.createNewTable();\n const millis: any = params['timestamp'];\n const timestamp = DateTime.fromMillis(millis).toLocal();\n if (this.addTimestampRow) {\n Tooltip.addTimeHeader(timestamp, table, sanitizer);\n }\n\n Tooltip.addHeader('Caution: abnormal value', table, sanitizer);\n return table.outerHTML;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {SecurityContext} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport * as Color from 'color';\nimport * as Colors from '../../theme/verily_colors';\nimport {DateTime} from 'luxon';\n\n/*\n * This base class contains useful helper methods used while making a custom\n * tooltip for a c3 chart, including adding a row to the table, resetting the\n * table, and adding a header.\n *\n * This is functionally a static class, but Typescript doesn't allow for\n * abstract static functions. We make all tooltip classes inherit from Tooltip\n * so that they must implement the getTooltip function.\n *\n * @param T The type of data that the tooltip is derived from.\n */\nexport abstract class Tooltip {\n /**CSS styling for normal tooltip circular color swatch */\n static readonly TOOLTIP_NORMAL_CSS = 'display: inline-block; height: 10px; width: 10px; ' +\n 'margin-right: 6px; border-radius: 50%;';\n /**CSS styling for abnormal tooltip triangular color swatch */\n static readonly TOOLTIP_ABNORMAL_CSS = 'width: 0; display:inline-block; margin-right: 6px; ' +\n 'height: 0; border-left: 6px solid transparent; ' +\n 'border-right: 6px solid transparent; border-bottom: ' +\n '6px solid ';\n\n /**\n * Creates a new table for the tooltip. Returns a HTMLTableElement.\n */\n static createNewTable(): HTMLTableElement {\n const table: HTMLTableElement = document.createElement('table');\n table.setAttribute('class', 'c3-tooltip');\n return table;\n }\n\n /**\n * Adds a header on the tooltips depicting the timepoint of the data\n * @param timestamp DateTime reflecting the datapoint depicted on the tooltip\n * @param table HTMLTableElement on the tooltip that needs to be edited\n * @param sanitizer A DOM sanitizer\n * @param colSpan The number of columns that the header spans\n */\n static addTimeHeader(\n timestamp: DateTime, table: HTMLTableElement, sanitizer: DomSanitizer,\n colSpan = 2) {\n Tooltip.addHeader(\n Tooltip.formatTimestamp(timestamp), table, sanitizer, colSpan);\n }\n\n /**\n * Returns a string of the timestamp in format: MM/DD/YYYY HH:MM\n * @param timestamp DateTime reflecting the datapoint depicted on the tooltip\n */\n static formatTimestamp(timestamp: DateTime) {\n return timestamp.toLocal().toLocaleString() + ' ' +\n timestamp.toLocal().toLocaleString(DateTime.TIME_24_SIMPLE);\n }\n\n /**\n * Adds a header to the HTMLTableElement\n * @param content String reflecting content inside the header\n * @param table HTMLTableElement on the tooltip that needs to be edited\n * @param sanitizer A DOM sanitizer\n * @param colSpan The number of columns that the header spans\n */\n static addHeader(\n content: string, table: HTMLTableElement, sanitizer: DomSanitizer,\n colSpan = 2) {\n // Header row\n const row = table.insertRow();\n const headerCell = document.createElement('th');\n row.appendChild(headerCell);\n headerCell.colSpan = colSpan;\n headerCell.innerHTML = sanitizer.sanitize(SecurityContext.HTML, content);\n }\n\n /**\n * Adds row to the HTMLTableElement\n * @param table HTMLTableElement on the tooltip that needs to be edited\n * @param cellText String array reflecting the content on the tooltip\n * @param sanitizer A DOM sanitizer\n * @param color Color that is displayed on the legend and the graph.\n * @param isAbnormal Boolean that depicts whether the datapoint is abnormal\n */\n static addRow(\n table: HTMLTableElement, cellText: string[], sanitizer: DomSanitizer,\n color?: Color, isAbnormal?: boolean) {\n const row = table.insertRow();\n for (let i = 0; i < cellText.length; i++) {\n const cell1 = row.insertCell();\n if (i === 0) {\n cell1.className = 'name';\n if (isAbnormal) {\n cell1.setAttribute('style', 'color: ' + Colors.ABNORMAL);\n }\n if (color) {\n cell1.appendChild(Tooltip.makeColorSwatch(color, isAbnormal));\n const div = document.createElement('div');\n div.setAttribute('style', 'display: inline-block;');\n div.innerHTML = sanitizer.sanitize(SecurityContext.HTML, cellText[i]);\n cell1.appendChild(div);\n continue;\n }\n } else {\n cell1.className = 'value';\n if (isAbnormal) {\n cell1.setAttribute('style', 'color: ' + Colors.ABNORMAL);\n }\n }\n cell1.innerHTML = sanitizer.sanitize(SecurityContext.HTML, cellText[i]);\n }\n }\n\n /**\n * Helper function that creates the color swatch on the tooltips. If it\n * is regular, it is rectangular. If it is abnormal, it is triangular.\n * @param color Color that is displayed on the legend and the graph.\n * @param isAbnormal Boolean that depicts whether the datapoint is abnormal\n */\n static makeColorSwatch(color: Color, isAbnormal: boolean = false): HTMLSpanElement {\n const colorSpan: HTMLSpanElement = document.createElement('span');\n if (isAbnormal) {\n // Creates a triangular color swatch\n colorSpan.setAttribute(\n 'style',\n this.TOOLTIP_ABNORMAL_CSS + color.toString());\n } else {\n // Creates a circular color swatch\n colorSpan.setAttribute(\n 'style',\n 'background-color: ' + color.toString() + '; ' + this.TOOLTIP_NORMAL_CSS);\n }\n return colorSpan;\n }\n\n abstract getTooltip(inputValue: T, sanitizer: DomSanitizer): string;\n}\n\n/**\n * This is a generic tooltip for a data point on the graph. It just takes in\n * the data points C3 provides to the tooltip function, then returns a table\n * with a header of the timestamp and a row for each included point.\n * The left hand side of each row is the series label. The right hand side of\n * each row is the y-value.\n */\nexport class StandardTooltip extends Tooltip {\n constructor(\n private dataPoints: any[], private color: Function, private unit = '') {\n super();\n }\n\n getTooltip(unused: any, sanitizer: DomSanitizer): string {\n const table = Tooltip.createNewTable();\n Tooltip.addTimeHeader(\n DateTime.fromJSDate(new Date(this.dataPoints[0].x)), table, sanitizer);\n\n for (const pt of this.dataPoints) {\n Tooltip.addRow(\n table, [pt.name, pt.value + ' ' + this.unit], sanitizer,\n this.color(pt));\n }\n return table.outerHTML;\n }\n}\n","module.exports = \".stepContent {\\n margin-bottom: 30px;\\n margin-top: 10px;\\n font-size: 20px;\\n}\\n\\n::ng-deep .mat-horizontal-content-container {\\n padding-bottom: 0px !important;\\n}\\n\\n.stepperButtons {\\n float: right;\\n}\\n\\n.stepperButtons button {\\n margin-right: 5px;\\n}\\n\\n::ng-deep .mat-dialog-container {\\n max-height: 500px !important;\\n}\\n\\nimg {\\n max-width: 100%;\\n}\\n\\n.divider {\\n margin-bottom: 20px;\\n margin-top: 10px;\\n border-top-width: 5px !important;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvaGVscC1kaWFsb2cvaGVscC1kaWFsb2cuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLG1CQUFtQjtFQUNuQixnQkFBZ0I7RUFDaEIsZUFBZTtBQUNqQjs7QUFFQTtFQUNFLDhCQUE4QjtBQUNoQzs7QUFFQTtFQUNFLFlBQVk7QUFDZDs7QUFFQTtFQUNFLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUNFLDRCQUE0QjtBQUM5Qjs7QUFFQTtFQUNFLGVBQWU7QUFDakI7O0FBRUE7RUFDRSxtQkFBbUI7RUFDbkIsZ0JBQWdCO0VBQ2hCLGdDQUFnQztBQUNsQyIsImZpbGUiOiJzcmMvYXBwL2hlbHAtZGlhbG9nL2hlbHAtZGlhbG9nLmNvbXBvbmVudC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuc3RlcENvbnRlbnQge1xuICBtYXJnaW4tYm90dG9tOiAzMHB4O1xuICBtYXJnaW4tdG9wOiAxMHB4O1xuICBmb250LXNpemU6IDIwcHg7XG59XG5cbjo6bmctZGVlcCAubWF0LWhvcml6b250YWwtY29udGVudC1jb250YWluZXIge1xuICBwYWRkaW5nLWJvdHRvbTogMHB4ICFpbXBvcnRhbnQ7XG59XG5cbi5zdGVwcGVyQnV0dG9ucyB7XG4gIGZsb2F0OiByaWdodDtcbn1cblxuLnN0ZXBwZXJCdXR0b25zIGJ1dHRvbiB7XG4gIG1hcmdpbi1yaWdodDogNXB4O1xufVxuXG46Om5nLWRlZXAgLm1hdC1kaWFsb2ctY29udGFpbmVyIHtcbiAgbWF4LWhlaWdodDogNTAwcHggIWltcG9ydGFudDtcbn1cblxuaW1nIHtcbiAgbWF4LXdpZHRoOiAxMDAlO1xufVxuXG4uZGl2aWRlciB7XG4gIG1hcmdpbi1ib3R0b206IDIwcHg7XG4gIG1hcmdpbi10b3A6IDEwcHg7XG4gIGJvcmRlci10b3Atd2lkdGg6IDVweCAhaW1wb3J0YW50O1xufSJdfQ== */\"","module.exports = \"
\\n \\n
\\n\\n \\n \\n {{index +1}}\\n \\n \\n
\\n
\\n MedTimeLine Configuration Screen\\n
\\n \\n
\\n
\\n \\n
\\n
\\n\\n \\n
\\n
\\n
\\n Click on the current date range to open the datepicker.\\n
\\n \\n
\\n \\n
\\n
\\n Choose a patient encounter or pre-set time period on the left.\\n
\\n \\n
\\n \\n
\\n
\\n Alternatively, choose a custom date range.\\n
\\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n\\n \\n
\\n
\\n The Custom Timeline feature allows you to enter custom events.\\n
\\n
\\n
\\n Click the pencil icon to enter edit mode.\\n
\\n \\n
\\n \\n
\\n
\\n Click the timeline at a place where you would like to add a flag.\\n
\\n \\n
\\n \\n
\\n
\\n In the dialog box, enter a title, description, and select a color for the flag.\\n
\\n \\n
\\n \\n
\\n
\\n You can also manually adjust the date and/or time.\\n
\\n
\\n While in edit mode, you can edit an existing flag, which will open up the dialog box again.\\n
\\n \\n
\\n \\n
\\n
\\n You can also remove flags while in edit mode.\\n
\\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n\\n \\n
\\n
\\n You can enter notes in the main timeline display area.\\n
\\n
\\n
\\n Click the pencil icon to enter edit mode.\\n
\\n \\n
\\n \\n
\\n
\\n Type in your notes, and click the save button to save the note.\\n
\\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n\\n \\n
\\n
\\n You can add, remove, and rearrange timelines to optimize the data view for specific patients.\\n
\\n
\\n
\\n To add a timeline, click the plus sign, then select Add Data Timeline.\\n Select the timeline type you want to add, then select the specific timeline.\\n
\\n \\n
\\n \\n
\\n You can also add another Custom Timeline or text notes. You can also search for concept through the autocomplete\\n input.\\n
\\n \\n \\n
\\n To remove a timeline, hover your cursor over the timeline you want to remove. Click the X in the upper left\\n corner of the timeline.\\n
\\n \\n \\n
\\n You can undo a deletion of a card, as well.\\n
\\n \\n \\n
\\n To rearrange timelines, click the label or colored handle on the left hand side of the timeline you want to\\n move, and hold the mouse button and drag and drop the timeline to your desired location.\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n\\n \\n
\\n
\\n Timelines are categorized and color-coded by a vertical bar on the leftmost side of the data timeline.\\n
\\n
\\n
\\n You can hover over plotted data point and additional data displays in a tooltip.\\n
\\n \\n \\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n
\"","import {Component} from '@angular/core';\nimport {MatDialogRef} from '@angular/material';\n\n\n/**\n * This class holds the logic and template for a tutorial stepper dialog.\n */\n@Component({\n selector: 'app-help-dialog',\n templateUrl: './help-dialog.component.html',\n styleUrls: ['./help-dialog.component.css']\n})\nexport class HelpDialogComponent {\n constructor(public dialogRef: MatDialogRef) {}\n\n onExit() {\n this.dialogRef.close();\n }\n}\n","module.exports = \"::ng-deep .ifuViewer {\\n height: 300px;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvaWZ1LWRpYWxvZy9pZnUtZGlhbG9nLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxhQUFhO0FBQ2YiLCJmaWxlIjoic3JjL2FwcC9pZnUtZGlhbG9nL2lmdS1kaWFsb2cuY29tcG9uZW50LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIjo6bmctZGVlcCAuaWZ1Vmlld2VyIHtcbiAgaGVpZ2h0OiAzMDBweDtcbn1cbiJdfQ== */\"","module.exports = \"

MedTimeLine Instructions For Use

\\n
\\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component} from '@angular/core';\nimport {MatDialogRef} from '@angular/material';\n\n@Component({\n selector: 'app-ifu-dialog',\n templateUrl: './ifu-dialog.component.html',\n styleUrls: ['./ifu-dialog.component.css']\n})\nexport class IfuDialogComponent {\n constructor(public dialogRef: MatDialogRef) {}\n\n onExit() {\n this.dialogRef.close();\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {HttpClient} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {DateTime, Interval} from 'luxon';\nimport {FhirResourceType} from 'src/constants';\nimport {v4 as uuid} from 'uuid';\n\nimport {environment} from '../environments/environment';\n\nimport {BCHMicrobioCodeGroup} from './clinicalconcepts/bch-microbio-code';\nimport {LOINCCode} from './clinicalconcepts/loinc-code';\nimport {ResourceCode} from './clinicalconcepts/resource-code-group';\nimport {RxNormCode} from './clinicalconcepts/rx-norm';\nimport {DiagnosticReport} from './fhir-data-classes/diagnostic-report';\nimport {Encounter} from './fhir-data-classes/encounter';\nimport {MedicationAdministration} from './fhir-data-classes/medication-administration';\nimport {MedicationOrder} from './fhir-data-classes/medication-order';\nimport {Observation, ObservationStatus} from './fhir-data-classes/observation';\nimport {FhirService} from './fhir.service';\n\n@Injectable()\nexport class MockFhirService extends FhirService {\n private readonly assetPath = './assets/' + environment.mockDataFolder + '/';\n private readonly allFilePaths =\n environment.mockDataFiles.map(x => this.assetPath + x + '.json');\n\n private readonly loincMap = new Map();\n private readonly medicationAdministrationMapByCode =\n new Map();\n private readonly medicationAdministrationMapByOrderId =\n new Map();\n private readonly medicationOrderMap = new Map();\n private readonly encounters = new Array();\n private readonly allDataPromise: Promise;\n private microbioJson: JSON;\n\n private constructResourceMap(\n json: any, mapToUpdate: Map, constructorFn: (any) => V,\n getCodesFn: (value: V) => K[]) {\n try {\n const obj = constructorFn(json.resource);\n const uniqueCodes = Array.from(new Set(getCodesFn(obj)));\n for (const code of uniqueCodes) {\n let existing = mapToUpdate.get(code);\n if (!existing) {\n existing = [];\n }\n existing.push(obj);\n mapToUpdate.set(code, existing);\n }\n } catch (err) {\n // tslint:disable-next-line:no-console\n console.debug(err);\n }\n }\n\n private mapAllData(): Promise {\n return Promise.all(this.allFilePaths.map(filePath => {\n return this.http.get(filePath).toPromise().then(data => {\n if (filePath.includes('_MB_data')) {\n this.microbioJson = data;\n }\n try {\n let entry = data.entry;\n // Sometimes data comes to us in bundles, and then we want to flatten\n // it into a series of resources.\n if (data.length > 0) {\n entry = data.map(bundle => bundle.entry).flat();\n }\n for (const json of entry) {\n const mockRequestId = uuid();\n const resourceType = json.resource.resourceType;\n if (resourceType === FhirResourceType.Observation) {\n this.constructResourceMap(\n json, this.loincMap,\n (x: any) => new Observation(x, mockRequestId),\n (obs) => obs.codes);\n }\n\n if (resourceType === FhirResourceType.MedicationAdministration) {\n this.constructResourceMap(\n json, this.medicationAdministrationMapByCode,\n (d) => new MedicationAdministration(d, mockRequestId),\n (admin) => [admin.rxNormCode]);\n\n this.constructResourceMap(\n json, this.medicationAdministrationMapByOrderId,\n (d) => new MedicationAdministration(d, mockRequestId),\n (admin) => [admin.medicationOrderId]);\n }\n\n if (resourceType === FhirResourceType.MedicationOrder) {\n this.constructResourceMap(\n json, this.medicationOrderMap,\n (d) => new MedicationOrder(d, mockRequestId),\n (order) => [order.orderId]);\n }\n\n if (resourceType === FhirResourceType.Encounter) {\n const encounter = new Encounter(json.resource, mockRequestId);\n this.encounters.push(encounter);\n }\n }\n } catch {\n console.warn(\n 'Trouble reading file: ' + filePath +\n '. Continuing on since this is the mock server.');\n }\n });\n }));\n }\n\n constructor(private http: HttpClient) {\n super();\n this.allDataPromise = this.mapAllData();\n }\n\n /**\n * Gets observations from a specified date range with a specific LOINC code.\n * @param code The LOINC code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount If set, the number of observations that should be\n * queried for\n */\n getObservationsWithCode(\n code: LOINCCode,\n dateRange: Interval,\n ): Promise {\n return this.allDataPromise.then(\n map => this.getObservations(this.loincMap, code, dateRange));\n }\n\n private getObservations(\n map: Map, code: LOINCCode,\n dateRange: Interval) {\n return map.has(code) ?\n map.get(code)\n .filter(obs => dateRange.contains(obs.timestamp))\n .filter(obs => obs.status !== ObservationStatus.EnteredInError) :\n [];\n }\n\n observationsPresentWithCode(code: LOINCCode, dateRange: Interval):\n Promise {\n return this.getObservationsWithCode(code, dateRange)\n .then(results => results.length > 0);\n }\n\n /**\n * Gets medication data from a specified date range with a specific Rx code\n * @param code The RxNormCode codes for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount Unused in this implementation, as this is just a\n * time-saving feature for HTTP calls.\n */\n getMedicationAdministrationsWithCode(\n code: RxNormCode, dateRange: Interval,\n limitCount?: number): Promise {\n return this.allDataPromise.then(x => {\n return this.medicationAdministrationMapByCode.has(code) ?\n this.medicationAdministrationMapByCode.get(code)\n .filter(obs => dateRange.contains(obs.timestamp))\n .slice(0, limitCount ? limitCount : undefined) :\n [];\n });\n }\n\n medicationsPresentWithCode(code: RxNormCode, dateRange: Interval):\n Promise {\n return this.getMedicationAdministrationsWithCode(code, dateRange)\n .then(obs => obs.length > 0, rejection => {\n // If any MedicationAdministration for this code results in an error,\n // do not show any MedicationAdministrations at all.\n throw rejection;\n });\n }\n\n /**\n * Returns arbitrary orders for current mock medications.\n * @param id The id to pull the order from.\n */\n getMedicationOrderWithId(id: string): Promise {\n return this.allDataPromise.then(\n x => this.medicationOrderMap.has(id) ?\n this.medicationOrderMap.get(id)[0] :\n undefined);\n }\n\n /**\n * Gets administrations for specified order id.\n * @param id The id to pull the order from.\n */\n getMedicationAdministrationsWithOrder(id: string, code: RxNormCode):\n Promise {\n return this.allDataPromise.then(\n x => this.medicationAdministrationMapByOrderId.get(id));\n }\n\n /**\n * Gets the encounters for the patient for any encounter that falls in the\n * given date range.\n * @param dateRange Return all encounters that covered any time in this\n * date range.\n */\n getEncountersForPatient(dateRange: Interval): Promise {\n return this.allDataPromise.then(\n x => this.encounters.filter(\n encounter => dateRange.intersection(encounter.period) !== null &&\n encounter.period.start >= DateTime.utc().minus({years: 1})));\n }\n\n /**\n * Prints the current HTML of the graphs rendered to the console.\n * @param html The inner HTML to keep in the Document.\n * @param date The date the note was written for.\n */\n saveStaticNote(image: HTMLCanvasElement, date: string): Promise {\n console.log('Save to note button clicked for mock data for date: ' + date);\n console.log(image);\n return Promise.resolve(true);\n }\n\n /**\n * Gets the DiagnosticReports for the patient for any report that falls in\n * the given date range, whose contained Observations are in the codeGroup\n * provided.\n * @param codeGroup The CodeGroup to retrieve DiagnosticReports for.\n * @param dateRange Return all DiagnosticReports that covered any time in\n * this date range.\n */\n getDiagnosticReports(\n codeGroup: BCHMicrobioCodeGroup, dateRange: Interval,\n limitCount?: number): Promise {\n return this.allDataPromise.then(x => {\n return DiagnosticReport.parseAndFilterMicrobioData(\n this.microbioJson, codeGroup);\n });\n }\n}\n","/**\n * Error class for errors with request IDs.\n * Formats the error message with the list of request IDs, the message,\n * and optional json.\n */\nexport class ResultError extends Error {\n readonly shortMessage;\n\n constructor(requestIds: Set, message: string, json?: any) {\n const requestIDMessage = requestIds.size > 0 ?\n `Request IDs: ${Array.from(requestIds).join(', ')}.\\n` :\n '';\n const shortMessage = requestIDMessage + message;\n let completeMessage = shortMessage;\n if (json) {\n completeMessage += `\\nJSON: ${JSON.stringify(json, null, 4)}`;\n }\n super(completeMessage);\n // 'super' needs to be called before accessing 'this', so we need to set\n // this.shortMessage after calling 'super'.\n this.shortMessage = shortMessage;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Injectable} from '@angular/core';\nimport {Interval} from 'luxon';\n\nimport {Encounter} from './fhir-data-classes/encounter';\nimport {AxisGroup} from './graphtypes/axis-group';\nimport {ResultError} from './result-error';\n\n/**\n * This class is a service that communicates the user-selected concepts on the\n * configuration page (SetupComponent) to CardContainerComponent.\n */\n@Injectable({providedIn: 'root'})\nexport class SetupDataService {\n /** Which concepts to display. */\n selectedConcepts: AxisGroup[];\n /** Which encounters to show in the date picker. */\n encounters: Encounter[];\n encountersError?: ResultError;\n /**\n * The first date range to load into the app.\n */\n selectedDateRange: Interval;\n}\n","module.exports = \"button {\\n margin-right: 10px;\\n}\\n\\nh3 {\\n padding: 5px;\\n margin: 10px;\\n}\\n\\nh1, h2 {\\n font-family: 'Montserrat', sans-serif;\\n}\\n\\n.search-icon {\\n padding-top: 20px;\\n vertical-align: bottom;\\n}\\n\\n.actions {\\n margin-left: auto;\\n padding: 20px;\\n}\\n\\n.category {\\n padding-left: 10px;\\n}\\n\\n.mainSetup {\\n width: 100%;\\n padding-top: 20px;\\n padding-left: 40px;\\n color: white;\\n height: 100%;\\n}\\n\\n.conceptOptions {\\n padding-left: 25px;\\n}\\n\\n::ng-deep .mat-toolbar-row, .mat-toolbar-single-row {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n}\\n\\n.defaultBackgroundColor {\\n background-color: #202020; /* Grey 900 */\\n}\\n\\n.accentBackgroundColor {\\n /* Deep Purple 800 to Pink 900 */\\n background-image: -webkit-gradient(linear, left top, right top, from(#4527A0) , to(#870D4E));\\n background-image: linear-gradient(to right, #4527A0 , #870D4E);\\n color: white;\\n}\\n\\n::ng-deep app-setup .mat-form-field-wrapper {\\n color: white;\\n}\\n\\n::ng-deep app-setup .mat-checkbox-frame {\\n border-color: white;\\n}\\n\\n::ng-deep app-setup .mat-radio-outer-circle {\\n border-color: white;\\n}\\n\\n::ng-deep app-setup .mat-checkbox-disabled .mat-checkbox-label {\\n color: gray;\\n}\\n\\n::ng-deep app-setup .mat-form-field-empty.mat-form-field-label {\\n color: white;\\n}\\n\\n::ng-deep app-setup .mat-form-field-label {\\n color:white !important;\\n}\\n\\n::ng-deep app-setup .mat-form-field-underline {\\n background-color: white !important;\\n}\\n\\n::ng-deep app-setup .mat-form-field.mat-focused .mat-form-field-ripple {\\n background-color: white !important;\\n}\\n\\n::ng-deep app-setup .mat-form-field-underline {\\n background-color: white !important;\\n}\\n\\napp-setup .mat-input-placeholder {\\n color: white;\\n}\\n\\n.encounters-error {\\n width: 50%;\\n margin-bottom: 16px;\\n white-space: pre-wrap;\\n word-break: break-all;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvc2V0dXAvc2V0dXAuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLFlBQVk7RUFDWixZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxxQ0FBcUM7QUFDdkM7O0FBRUE7RUFDRSxpQkFBaUI7RUFDakIsc0JBQXNCO0FBQ3hCOztBQUVBO0VBQ0UsaUJBQWlCO0VBQ2pCLGFBQWE7QUFDZjs7QUFFQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLFdBQVc7RUFDWCxpQkFBaUI7RUFDakIsa0JBQWtCO0VBQ2xCLFlBQVk7RUFDWixZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxrQkFBa0I7QUFDcEI7O0FBRUE7RUFDRSxvQkFBYTtFQUFiLGFBQWE7RUFDYixvQkFBb0I7QUFDdEI7O0FBRUE7RUFDRSx5QkFBeUIsRUFBRSxhQUFhO0FBQzFDOztBQUVBO0VBQ0UsZ0NBQWdDO0NBQ2pDLDRGQUE4RDtDQUE5RCw4REFBOEQ7Q0FDOUQsWUFBWTtBQUNiOztBQUVBO0VBQ0UsWUFBWTtBQUNkOztBQUVBO0VBQ0UsbUJBQW1CO0FBQ3JCOztBQUVBO0VBQ0UsbUJBQW1CO0FBQ3JCOztBQUVBO0VBQ0UsV0FBVztBQUNiOztBQUNBO0VBQ0UsWUFBWTtBQUNkOztBQUVBO0VBQ0Usc0JBQXNCO0FBQ3hCOztBQUVBO0VBQ0Usa0NBQWtDO0FBQ3BDOztBQUVBO0VBQ0Usa0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gYmFja2dyb3VuZC1jb2xvcjogd2hpdGUgIWltcG9ydGFudDtcbn1cblxuOjpuZy1kZWVwIGFwcC1zZXR1cCAubWF0LWZvcm0tZmllbGQtdW5kZXJsaW5lIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogd2hpdGUgIWltcG9ydGFudDtcbn1cblxuYXBwLXNldHVwIC5tYXQtaW5wdXQtcGxhY2Vob2xkZXIge1xuICBjb2xvcjogd2hpdGU7XG59XG5cbi5lbmNvdW50ZXJzLWVycm9yIHtcbiAgd2lkdGg6IDUwJTtcbiAgbWFyZ2luLWJvdHRvbTogMTZweDtcbiAgd2hpdGUtc3BhY2U6IHByZS13cmFwO1xuICB3b3JkLWJyZWFrOiBicmVhay1hbGw7XG59XG4iXX0= */\"","module.exports = \"\\n

{{uiConstants.INITIAL_CONFIGURATION_HEADER}}  

\\n \\n
\\n \\n
\\n
\\n
\\n \\n
\\n
\\n
\\n

{{uiConstants.WHICH_ENCOUNTER_FIRST}}

\\n \\n \\n errorError loading patient encounters.\\n Technical details:
{{setupDataService.encountersError.message}}\\n
\\n \\n
\\n \\n {{encounter.period.toFormat('MM/dd/yyyy')}} {{uiConstants.ENCOUNTER}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_THREE_MONTHS}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_MONTH}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_SEVEN_DAYS}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_THREE_DAYS}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_ONE_DAY}}\\n \\n
\\n
\\n
\\n
\\n

{{uiConstants.WHICH_CONCEPTS_FIRST}}

\\n \\n \\n
\\n
\\n \\n \\n search\\n \\n
\\n
\\n

{{entry[0].label}}

\\n
\\n
\\n \\n {{element.label}} {{uiConstants.NO_DATA_PAST_SIX_MOS}}\\n {{uiConstants.CHECKING_DATA_AVAILABILITY}}\\n \\n
\\n
\\n
\\n {{uiConstants.NO_RESULTS}}\\n
\\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, Inject, OnDestroy, OnInit, ViewChild} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {MatRadioGroup} from '@angular/material/radio';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {DateTime, Interval} from 'luxon';\nimport {Observable} from 'rxjs';\nimport {map, startWith} from 'rxjs/operators';\nimport {APP_TIMESPAN, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {environment} from '../../environments/environment';\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\nimport {ResourceCodeManager} from '../clinicalconcepts/resource-code-manager';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {FhirService} from '../fhir.service';\nimport {AxisGroup} from '../graphtypes/axis-group';\nimport {ResultError} from '../result-error';\nimport {SetupDataService} from '../setup-data.service';\n\nenum LoadStatus {\n LOADING,\n DATA_AVAILABLE,\n DATA_UNAVAILABLE\n}\n\n/**\n * Contains the intial configuration options for the MedTimeLine.\n * Users can choose which concepts to display, or pick the default\n * configuration.\n */\n@Component({\n selector: 'app-setup',\n templateUrl: './setup.component.html',\n styleUrls: ['./setup.component.css']\n})\nexport class SetupComponent implements OnInit, OnDestroy {\n readonly allConcepts = new Array();\n readonly checkedConcepts = new Map();\n readonly chosenConcepts = new Array();\n readonly useDebugger = environment.useDebugger;\n\n readonly statusConsts = LoadStatus;\n\n /**\n * Which encounter to load into the app first.\n */\n @ViewChild(MatRadioGroup) selectedDateRange: MatRadioGroup;\n\n /**\n * This FormControl monitors changes in the user input typed in the\n * autocomplete.\n */\n readonly conceptCtrl = new FormControl();\n /**\n * An Observable of filtered [DisplayGrouping, ResourceCodesForCard[] pairings\n * based on user input in the autocomplete. Each element of the array contains\n * a DisplayGrouping and filtered ResourceCodesForCards that belong to that\n * DisplayGrouping.\n */\n displayGroupingOptions: Observable>;\n\n /**\n * An array of DisplayGroupings and AxisGroup that belong to that\n * grouping.\n */\n readonly displayGroupings: Array<[DisplayGrouping, AxisGroup[]]>;\n\n /**\n * Holds whether there's any data available for each resource code group.\n */\n readonly codeGroupAvailable = new Map();\n\n /**\n * List of times the patient was in the hospital.\n */\n encounters: Encounter[];\n\n // Fixed time periods to offer as options for selection.\n today: DateTime = DateTime.local().startOf('day');\n readonly lastOneDay =\n Interval.fromDateTimes(this.today.minus({days: 1}), this.today);\n readonly lastThreeDays =\n Interval.fromDateTimes(this.today.minus({days: 3}), this.today);\n readonly lastSevenDays =\n Interval.fromDateTimes(this.today.minus({days: 7}), this.today);\n readonly lastMonth =\n Interval.fromDateTimes(this.today.minus({months: 1}), this.today);\n readonly lastThreeMonths =\n Interval.fromDateTimes(this.today.minus({months: 3}), this.today);\n\n sortResources = (function(a, b) {\n return a.label.localeCompare(b.label);\n });\n\n ngOnDestroy() {\n // Pass the selected information through to the setup data service.\n this.setupDataService.selectedConcepts = this.chosenConcepts;\n this.setupDataService.encounters = this.encounters;\n this.setupDataService.selectedDateRange = this.selectedDateRange.value ?\n this.selectedDateRange.value :\n Interval.fromDateTimes(this.today.minus({days: 7}), this.today);\n }\n\n constructor(\n resourceCodeManager: ResourceCodeManager, private route: ActivatedRoute,\n private router: Router, private setupDataService: SetupDataService,\n private fhirService: FhirService,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n // Set up jut a couple things so we don't have to hold on to them as\n // unnecessary class variables.\n const displayGroups = resourceCodeManager.getDisplayGroupMapping();\n /* Load in the concepts to display, flattening them all into a\n * single-depth array. */\n this.allConcepts = Array.from(displayGroups.values())\n .reduce((acc, val) => acc.concat(val), []);\n\n this.displayGroupings = Array.from(displayGroups.entries());\n }\n\n ngOnInit() {\n // Watch for changes to the user input on the autocomplete panel.\n this.displayGroupingOptions = this.conceptCtrl.valueChanges.pipe(\n startWith(''), // The autocomplete input starts with nothing typed in.\n map(concept => concept ? this.filter(concept) :\n this.displayGroupings.slice()));\n\n for (const concept of this.allConcepts) {\n this.checkedConcepts[concept.label] = false;\n const showByDefault =\n concept.axes.some(axis => axis.resourceGroup.showByDefault);\n if (showByDefault) {\n this.checkedConcepts[concept.label] = true;\n }\n }\n\n // Retrieve the patient encounters. When they load in asynchronously,\n // the radio buttons for encounter selection will show up.\n this.setupDataService.encountersError = null;\n this.fhirService.getEncountersForPatient(APP_TIMESPAN)\n .then(\n encounters => {\n if (encounters.length > 0) {\n this.encounters = encounters.sort(\n (a, b) =>\n a.period.start.toMillis() - b.period.start.toMillis());\n }\n },\n rejection => {\n if (rejection instanceof ResultError) {\n this.setupDataService.encountersError = rejection;\n } else if (rejection instanceof Error) {\n this.setupDataService.encountersError =\n new ResultError(new Set(), rejection.message);\n } else {\n this.setupDataService.encountersError =\n new ResultError(new Set(), '', rejection);\n }\n });\n\n // Check to see which clinical concepts have any data, and enable/disable\n // on that basis.\n this.displayGroupings.forEach(grouping => {\n const resourceCodes = grouping[1];\n resourceCodes.forEach(rsc => {\n this.codeGroupAvailable.set(rsc.label, LoadStatus.LOADING);\n rsc.dataAvailableInAppTimeScope().then(available => {\n if (!available) {\n this.checkedConcepts[rsc.label] = false;\n this.codeGroupAvailable.set(rsc.label, LoadStatus.DATA_UNAVAILABLE);\n } else {\n this.codeGroupAvailable.set(rsc.label, LoadStatus.DATA_AVAILABLE);\n }\n });\n });\n });\n }\n\n /**\n * The user wishes to continue to the main screen of MedTimeLine, with all\n * charts selected.\n */\n onContinue() {\n for (const concept of this.allConcepts) {\n if (this.checkedConcepts[concept.label]) {\n this.chosenConcepts.push(concept);\n }\n }\n this.router.navigate(['/main'], {skipLocationChange: true});\n }\n\n /**\n * The user wishes to select all concepts.\n */\n selectAll() {\n for (const concept of this.allConcepts) {\n if (this.codeGroupAvailable.has(concept.label) &&\n this.codeGroupAvailable.get(concept.label) !==\n LoadStatus.DATA_UNAVAILABLE) {\n this.checkedConcepts[concept.label] = true;\n }\n }\n }\n\n /**\n * The user wishes to clear all select concepts.\n */\n clearAll() {\n for (const concept of this.allConcepts) {\n this.checkedConcepts[concept.label] = false;\n }\n }\n\n /**\n * Filter the concepts shown on the autocomplete menu.\n */\n filter(concept): any[] {\n return this.displayGroupings\n .filter(\n entry => entry[1].some(\n codes => codes.label.toLowerCase().indexOf(\n concept.toLowerCase()) === 0))\n .map(function(entry) {\n const displayGrouping: DisplayGrouping = entry[0];\n const resourceCodesFiltered = entry[1].filter(\n codes => codes.label.toLowerCase().indexOf(\n concept.toLowerCase()) === 0);\n return [displayGrouping, resourceCodesFiltered];\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {InjectionToken} from '@angular/core';\nexport let SMART_ON_FHIR_CLIENT = new InjectionToken('SmartOnFhirClient');\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport * as Color from 'color';\n/**\n * Encodings of the colors for Verily branding.\n */\n\n// Primary color palette\nexport const GREY_900 = Color('#202020');\nexport const BLACK = Color('#000000');\nexport const BLUE_A400 = Color('#2878FF');\nexport const BLUE_A700 = Color('#2861FF');\nexport const DEEP_PURPLE_600 = Color('#5E35B1');\nexport const DEEP_PURPLE_800 = Color('#4527A0');\nexport const PINK_A700 = Color('#C41061');\nexport const PINK_900 = Color('#870D4E');\nexport const PINK_A400 = Color('#FF1643');\nexport const PINK_A700_DARKER = Color('#D40000');\nexport const BLUE_GREY_100 = Color('#C3D7DB');\nexport const BLUE_GREY_500 = Color('#5F7C8A');\nexport const BLUE_GREY_50 = Color('#EBEEF0');\nexport const WHITE = Color('#FFFFFF');\n\n// Secondary color palette\nexport const CYAN = Color('#00C6EF');\nexport const DEEP_CYAN = Color('#009DB7');\nexport const TURQUOISE = Color('#07796A');\nexport const DEEP_TURQUOISE = Color('#045B4C');\nexport const GREEN = Color('#0D8D39');\nexport const DEEP_GREEN = Color('#056823');\nexport const LIME = Color('#80BA17');\nexport const DEEP_LIME = Color('#668E0E');\nexport const GOLD = Color('#FFB233');\nexport const DEEP_GOLD = Color('#C38419');\nexport const ORANGE = Color('#FF8117');\nexport const DEEP_ORANGE = Color('#C35308');\nexport const CORAL = Color('#FF5052');\nexport const DEEP_CORAL = Color('#C14047');\n\n// Color to indicate a selected item.\nexport const SELECTED = BLUE_GREY_50;\n\nexport const ABNORMAL = PINK_A700_DARKER;\n\n/**\n * Returns all the colors that are acceptable for data points to be plotted in.\n */\nexport function getDataColors(): Color[] {\n return [BLUE_A700, DEEP_PURPLE_800, PINK_900, GREEN, GOLD, ORANGE, TURQUOISE];\n}\n","module.exports = \".datePicker {\\n background-color: white;\\n padding-top: 20px;\\n}\\n\\n.mat-form-field {\\n width: 40%;\\n margin-right: 5%;\\n margin-left: 5%;\\n}\\n\\n::ng-deep .mat-h2 {\\n margin-bottom: 0px !important;\\n}\\n\\n/* Remove extra padding below the button. */\\n\\n::ng-deep .mat-mini-fab .mat-button-wrapper {\\n padding: 0px !important;\\n}\\n\\n::ng-deep .mat-h2 {\\n margin-bottom: 0px !important;\\n}\\n\\n::ng-deep td.available{\\n color: black;\\n}\\n\\n::ng-deep td.notInEncounter {\\n color: grey !important;\\n opacity: .5;\\n text-decoration: line-through;\\n}\\n\\n::ng-deep td.inEncounter {\\n color: #4527A0 !important; /* Deep Purple 800 */\\n background-color: #e5f3ec;\\n}\\n\\n::ng-deep td.active.available.inEncounter {\\n color: white !important;\\n}\\n\\ninput {\\n font-family: 'Work Sans', sans-serif;\\n}\\n\\n/* Change colors of ngx-datepicker to match custom material theme */\\n\\n::ng-deep .ranges button.active {\\n background-color: #4527A0 !important; /* Deep Purple 800 */\\n}\\n\\n::ng-deep .md-drppicker .btn {\\n background-color: #4527A0 !important; /* Deep Purple 800 */\\n}\\n\\n::ng-deep td.active.available {\\n background-color: #4527A0 !important; /* Deep Purple 800 */\\n}\\n\\n.errorIcon {\\n width: 40px;\\n height: 40px;\\n line-height: 40px;\\n cursor: default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1lICovXG46Om5nLWRlZXAgLnJhbmdlcyBidXR0b24uYWN0aXZlIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzQ1MjdBMCAhaW1wb3J0YW50OyAvKiBEZWVwIFB1cnBsZSA4MDAgKi9cbn1cblxuOjpuZy1kZWVwIC5tZC1kcnBwaWNrZXIgLmJ0biB7XG4gIGJhY2tncm91bmQtY29sb3I6ICM0NTI3QTAgIWltcG9ydGFudDsgLyogRGVlcCBQdXJwbGUgODAwICovXG59XG5cbjo6bmctZGVlcCB0ZC5hY3RpdmUuYXZhaWxhYmxlIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzQ1MjdBMCAhaW1wb3J0YW50OyAvKiBEZWVwIFB1cnBsZSA4MDAgKi9cbn1cblxuLmVycm9ySWNvbiB7XG4gIHdpZHRoOiA0MHB4O1xuICBoZWlnaHQ6IDQwcHg7XG4gIGxpbmUtaGVpZ2h0OiA0MHB4O1xuICBjdXJzb3I6IGRlZmF1bHQ7XG59XG4iXX0= */\"","module.exports = \"
\\n \\n \\n warning\\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, Inject, Input, OnInit, Output, Renderer2, ViewChild} from '@angular/core';\nimport {DateTime, Duration, Interval} from 'luxon';\nimport * as moment from 'moment';\nimport {DaterangepickerDirective} from 'ngx-daterangepicker-material';\nimport {APP_TIMESPAN, recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {getDaysForIntervalSet} from '../date_utils';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {ResultClass} from '../fhir-resource-set';\nimport {ResultError} from '../result-error';\n\n/**\n * Date range picker for selecting the time span to show in all the charts.\n *\n * There is a lot of messy date conversion in this class. The problem is that\n * we use luxon DateTime for our date handling across this application, but the\n * date range picker only works with Moment.js datetimes. The only format both\n * classes have converters for is JSDate, so we pass dates through that\n * several places.\n */\n@Component({\n selector: 'app-timeline-controller',\n templateUrl: './timeline-controller.component.html',\n styleUrls: ['./timeline-controller.component.css']\n})\nexport class TimelineControllerComponent implements OnInit {\n @Output() changeDateRange = new EventEmitter();\n @ViewChild(DaterangepickerDirective)\n pickerDirective: DaterangepickerDirective;\n\n /**\n * Holds the encounters for this patient.\n */\n @Input() encounters: Encounter[];\n\n /**\n * Holds the error if there was an error getting the encounters.\n */\n @Input() encountersError: ResultError;\n\n /**\n * Holds the date range to default to on initial setup. If unset, we'll\n * default to the last seven days.\n */\n @Input() selectedDateRange: Interval;\n\n /**\n * Holds all the ISO strings for days covered by all the patient encounters\n * above. Used to gray out datepicker options that are not part of\n * a patient's encounter.\n */\n private daysCoveredByAnEncounter = new Set();\n\n /** Bounds the dates that may be selected. */\n earliestAvailableDate = moment.utc(APP_TIMESPAN.start.toJSDate());\n readonly latestAvailableDate = moment.utc(APP_TIMESPAN.end.toJSDate());\n\n /** Selected timespan is past seven days by default. */\n readonly defaultDateRange = {\n startDate: moment(DateTime.local()\n .minus(Duration.fromObject({days: 7}))\n .startOf('day')\n .toJSDate()),\n endDate: moment(DateTime.local().startOf('day').toJSDate())\n };\n\n /**\n * The date range picker binds to this variable.\n */\n selected: {startDate: moment.Moment, endDate: moment.Moment};\n\n /** The list of encounters to display as available ranges to select. */\n readonly datePickerRanges = {};\n\n /**\n * Whether there was an encounter input into this component.\n */\n hasEncounterError = false;\n\n constructor(\n private renderer: Renderer2,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n ngOnInit() {\n // Set the initial date range selection and fire off a change event.\n const selectedRange = {\n startDate: moment(this.selectedDateRange.start.startOf('day').toJSDate()),\n endDate: moment(this.selectedDateRange.end.startOf('day').toJSDate())\n };\n this.selected = selectedRange;\n this.datesUpdated(selectedRange);\n\n // Set up the encounters in the date picker.\n if (this.encounters && this.encounters.length > 0 &&\n !this.encountersError) {\n this.hasEncounterError = false;\n\n this.encounters = this.encounters.sort(\n (a, b) => a.period.start.toMillis() - b.period.start.toMillis());\n\n // Set the minimum date to select to be the beginning of the\n // earliest encounter that had days that fell inside the app\n // timespan, in UTC.\n this.earliestAvailableDate = moment(\n this.encounters[0].period.start.startOf('day').toUTC().toJSDate());\n\n // We have to store everything as an ISO string because if we\n // store as objects the set membership check doesn't work.\n this.daysCoveredByAnEncounter = new Set(\n getDaysForIntervalSet(this.encounters.map(x => x.period))\n .map(x => x.toISO().slice(0, 10)));\n\n // We manually update the ranges stored in the daterangepicker\n // so that the list of encounters is displayed.\n // We store these in local time to prevent errors with\n // displaying a date different than the dates of the encounter.\n // While being communicated with charts, the interval will be\n // converted to UTC.\n for (const encounter of this.encounters) {\n const start = moment(encounter.period.start.startOf('day').toJSDate());\n const end = moment(encounter.period.end.endOf('day').toJSDate());\n const label =\n start.format('MM/DD/YYYY') + '-' + end.format('MM/DD/YYYY');\n this.datePickerRanges[label] = [start, end];\n }\n this.datePickerRanges[this.uiConstants.LAST_ONE_DAY] = [\n moment(DateTime.local()\n .minus(Duration.fromObject({days: 1}))\n .startOf('day')\n .toJSDate()),\n this.defaultDateRange.endDate\n ];\n this.datePickerRanges[this.uiConstants.LAST_THREE_DAYS] = [\n moment(DateTime.local()\n .minus(Duration.fromObject({days: 3}))\n .startOf('day')\n .toJSDate()),\n this.defaultDateRange.endDate\n ];\n this.datePickerRanges[this.uiConstants.LAST_SEVEN_DAYS] =\n [this.defaultDateRange.startDate, this.defaultDateRange.endDate];\n this.datePickerRanges[this.uiConstants.LAST_MONTH] = [\n moment(DateTime.local()\n .minus(Duration.fromObject({months: 1}))\n .startOf('day')\n .toJSDate()),\n this.defaultDateRange.endDate\n ];\n this.datePickerRanges[this.uiConstants.LAST_THREE_MONTHS] = [\n moment(DateTime.local()\n .minus(Duration.fromObject({months: 3}))\n .startOf('day')\n .toJSDate()),\n this.defaultDateRange.endDate\n ];\n } else {\n this.hasEncounterError = true;\n }\n }\n\n /**\n * Used to add a style to dates in the date picker so that the user can\n * differentiate between dates inside and outside of encounters.\n */\n addCustomClass =\n (m: moment.Moment) => {\n // The slice gets jus tthe date portion of the ISO string.\n return this.daysCoveredByAnEncounter.has(m.toISOString().slice(0, 10)) ?\n 'inEncounter' :\n 'notInEncounter';\n }\n\n /**\n * Emits the date range picked in the date picker as an event.\n * @param range The date range selected in the picker.\n */\n datesUpdated(rangeIn: {startDate: moment.Moment, endDate: moment.Moment}) {\n if (!rangeIn.startDate || !rangeIn.endDate || !this.selected) {\n return;\n }\n if (rangeIn.startDate.isBefore(rangeIn.endDate)) {\n this.selected = rangeIn;\n // Convert to UTC time.\n const interval = Interval.fromDateTimes(\n DateTime.fromJSDate(rangeIn.startDate.toDate())\n .startOf('day')\n .toUTC(),\n DateTime.fromJSDate(rangeIn.endDate.toDate()).endOf('day').toUTC());\n this.changeDateRange.emit(interval);\n\n recordGoogleAnalyticsEvent(\n 'dateRangeChanged', 'timeline',\n interval.start.toLocaleString() + ' - ' +\n interval.end.toLocaleString());\n }\n }\n}\n","module.exports = \"
\\n \\n
{{uiConstants.SYNTH_DATA}}
\\n
{{uiConstants.LOINC_VERIFIED_STRING}}
\\n \\n \\n \\n \\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, Inject, Output} from '@angular/core';\nimport {MatDialog} from '@angular/material/dialog';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {environment} from '../../environments/environment';\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\nimport {ResourceCodeManager} from '../clinicalconcepts/resource-code-manager';\nimport {AxisGroup} from '../graphtypes/axis-group';\nimport {HelpDialogComponent} from '../help-dialog/help-dialog.component';\nimport {IfuDialogComponent} from '../ifu-dialog/ifu-dialog.component';\n\n@Component({\n selector: 'app-timeline-toolbar',\n templateUrl: './timeline-toolbar.component.html',\n styleUrls: ['../cardcontainer/cardcontainer.component.css']\n})\nexport class TimelineToolbarComponent {\n readonly displayGroupings: Array<[DisplayGrouping, AxisGroup[]]>;\n readonly showMockDataMessage = environment.useMockServer;\n\n @Output() saveSnapshot = new EventEmitter();\n @Output() addTextbox = new EventEmitter();\n\n constructor(\n resourceCodeManager: ResourceCodeManager, private helpDialog: MatDialog,\n private ifuDialog: MatDialog,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n const displayGroups = resourceCodeManager.getDisplayGroupMapping();\n this.displayGroupings = Array.from(displayGroups.entries());\n }\n\n // Emits an event indicating to CardContainer to save a snapshot of the page.\n snapshot() {\n this.saveSnapshot.emit();\n }\n\n // Emits an event indicating to CardContainer to add a blank textbox at the\n // top of the page.\n textbox() {\n this.addTextbox.emit();\n }\n\n openHelpDialog() {\n const dialogRef = this.helpDialog.open(HelpDialogComponent);\n recordGoogleAnalyticsEvent(\n 'viewTutorial', 'tutorial', new Date().toDateString());\n }\n\n openIFU() {\n const dialogRef = this.ifuDialog.open(IfuDialogComponent);\n recordGoogleAnalyticsEvent(\n 'viewTutorial', 'tutorial', new Date().toDateString());\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/**\n * This function replaces abbrevations and symbols in a unit string to comply\n * with EHRA guidelines.\n * @param unit The unit string to fix abbreviations of.\n */\nexport function fixUnitAbbreviations(unit: string): string {\n if (unit) {\n return unit.replace('uL', 'microL')\n .replace('ยต', 'micro')\n .replace('DegC', 'Deg C');\n }\n return undefined;\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {InjectionToken} from '@angular/core';\nimport {DateTime, Duration, Interval} from 'luxon';\n\nimport {environment} from './environments/environment';\n\nexport function recordGoogleAnalyticsEvent(\n eventName: string, eventCategory: string, eventLabel: string) {\n if ((window).gtag) {\n (window).gtag('event', eventName, {\n 'event_category': eventCategory,\n 'event_label': eventLabel\n });\n }\n}\n\n/** The period of time this app will search for patient encounters in. */\nexport const APP_TIMESPAN = environment.production ?\n Interval.fromDateTimes(\n DateTime.utc().minus(Duration.fromObject({months: 6})),\n DateTime.utc()) :\n Interval.fromDateTimes(\n DateTime.utc().minus(Duration.fromObject({months: 60})),\n DateTime.utc());\n\n/**\n * Do not consider any encounters with a start date earlier than a year from\n * now.\n */\nexport const EARLIEST_ENCOUNTER_START_DATE = DateTime.utc().minus({years: 1});\n\n/** Constants used for FHIR resource types. */\nexport enum FhirResourceType {\n Encounter = 'Encounter',\n Observation = 'Observation',\n MedicationAdministration = 'MedicationAdministration',\n MedicationOrder = 'MedicationOrder',\n DocumentReference = 'DocumentReference',\n Patient = 'Patient',\n Specimen = 'Specimen',\n Medication = 'Medication',\n DiagnosticReport = 'DiagnosticReport'\n}\n\n/**\n * Injection token for passing UI constants across the app.\n */\nexport let UI_CONSTANTS_TOKEN = new InjectionToken('UiConstantsToken');\n\n/**\n * UI constants text.\n */\nexport const UI_CONSTANTS = {\n SYNTH_DATA: 'This is synthesized data used only for demo purposes.',\n LOINC_VERIFIED_STRING:\n 'These BCH data mappings were verified 2019-04-30. v.1.0.2.0',\n // Tooltip for adding a card inline\n ADD_TIMELINE_HERE: 'Add timeline here',\n // Dialog for adding an event to the custom timeline\n ADD_TITLE_CUSTOM_EVENT: 'Add title',\n ADD_DESCRIPTION_CUSTOM_EVENT: 'Add description',\n ADD_CARD_HERE: 'Add card here',\n DATE_CUSTOM_EVENT: 'Date',\n TIME_CUSTOM_EVENT: 'Time',\n CANCEL: 'Cancel',\n SAVE: 'Save',\n CONTINUE: 'Continue',\n // Custom timeline constants\n ADD_CUSTOM_TIMELINE: 'Add Custom Timeline',\n CUSTOM_TIMELINE_LABEL: 'Custom Timeline',\n CUSTOM_TIMELINE_INSTRUCTIONS:\n 'Click on this graph to add a flag for anything you want to keep track of.',\n // Annotation constants\n ADD_ANNOTATION: 'Add Textbox',\n ANNOTATION_INSTRUCTIONS: 'Add your text here.',\n SAVE_TEXT_HINT: 'Click the save button to save your text.',\n EDIT_TEXT_HINT: 'Click the edit button to edit this text.',\n // Constants\n NO_DATA_AVAILABLE_TMPL: 'No data between ',\n // Used in menu to add timelines\n ADD_CHART: 'Add Data Timeline',\n SEARCH_FOR_A_CONCEPT: 'Search for a concept',\n // Confirmation dialog for removing a card\n REMOVE_CARD: 'Do you want to remove this card?',\n REMOVE_CARD_NO: 'No',\n REMOVE_CARD_YES: 'Yes, remove this card',\n // Error handling\n BAD_DATA_ERROR: 'Invalid data received. Please check the PowerChart.',\n BAD_ENCOUNTER_ERROR:\n 'Unable to retrieve hospital visit dates for this patient.' +\n ' You can select any time period in the past six months.',\n // Setup screen\n INITIAL_CONFIGURATION_HEADER: 'MedTimeLine',\n LAST_ONE_DAY: 'Since midnight yesterday',\n LAST_THREE_DAYS: 'Last three days',\n LAST_SEVEN_DAYS: 'Last seven days',\n LAST_MONTH: 'Last month',\n LAST_THREE_MONTHS: 'Last three months',\n NO_RESULTS: 'No results found',\n SELECT_ALL: 'Select all',\n CLEAR_SELECTION: 'Clear selection',\n NO_DATA_PAST_SIX_MOS: '(No data found for past six months)',\n CHECKING_DATA_AVAILABILITY: '(Checking data availability...)',\n WHICH_ENCOUNTER_FIRST: 'Which time period would you like to see first?',\n WHICH_CONCEPTS_FIRST: 'Which data timelines would you like to see first?',\n ENCOUNTER: '(patient encounter)',\n // Top banner constants\n CHANGE_DATE_RANGE: 'Change date range',\n MOCK_DATA_BANNER: 'This is synthesized data used for demo purposes only.',\n LAUNCH_TUTORIAL: 'Launch Tutorial',\n IFU: 'Open Instructions for Use',\n SAVE_TO_NOTE: 'Save a screenshot to a PowerChart clinical note',\n // Interacting with cards\n REMOVE_THIS_CARD: 'Remove this card',\n CARD_REMOVED: 'Card removed.',\n UNDO: 'Undo',\n DRAG_THIS_CARD: 'Drag and drop to move this card somewhere else',\n EDIT_THIS_CARD: 'Edit this card',\n SAVE_YOUR_WORK: 'Save your work on this card',\n // Saving to PowerChart\n SAVED_TO_POWERCHART: 'Screenshot saved to PowerChart.',\n ERROR_SAVED_TO_POWERCHART: 'Error saving to PowerChart.',\n DISMISS: 'Dismiss',\n};\n","// This file can be replaced during build by using the `fileReplacements` array.\n// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.\n// The list of file replacements can be found in `angular.json`.\n\nexport const environment = {\n production: false,\n useMockServer: true,\n mockDataFolder: 'demo_data/test_bmedtimeB',\n mockDataFiles: [\n 'BMedTimeB_Encounter',\n 'BMedTimeB_Obs_labs',\n 'BMedTimeB_Obs_vitals',\n 'BMedtimeB_MB_data',\n 'BMedTimeB_Med_Admins',\n 'BMedTimeB_Med_Orders',\n ],\n useDebugger: false,\n};\n\n/*\n * In development mode, to ignore zone related error stack frames such as\n * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can\n * import the following file, but please comment it out in production mode\n * because it will have performance impact when throw error\n */\nimport 'zone.js/dist/zone-error'; // Included with Angular CLI.\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {enableProdMode} from '@angular/core';\nimport {platformBrowserDynamic} from '@angular/platform-browser-dynamic';\n\nimport {AppModule} from './app/app.module';\nimport * as FhirConfig from './app/fhir_config';\nimport {environment} from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\n\nif (FhirConfig.googleAnalyticsTag) {\n // Global site tag (gtag.js) - Google Analytics\n document.write(\n ' ');\n document.write(\n '');\n} else {\n // If there is no Google Analytics Tag found, insert an empty script to\n // prevent errors with user interaction.\n document.write('');\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule).catch(\n err => console.log(err));\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./src/$_lazy_route_resource lazy namespace object","webpack:///./src/app/app-routing.module.ts","webpack:///./src/app/app.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/cardcontainer/cardcontainer.component.css","webpack:///./src/app/cardcontainer/cardcontainer.component.html","webpack:///./src/app/cardcontainer/cardcontainer.component.ts","webpack:///./src/app/cardtypes/card/card.component.css","webpack:///./src/app/cardtypes/card/card.component.html","webpack:///./src/app/cardtypes/card/card.component.ts","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component.css","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component.html","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component.ts","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline.component.css","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline.component.html","webpack:///./src/app/cardtypes/customizable-timeline/customizable-timeline.component.ts","webpack:///./src/app/cardtypes/legendstyles.css","webpack:///./src/app/cardtypes/multigraphcard/multigraphcard.component.css","webpack:///./src/app/cardtypes/multigraphcard/multigraphcard.component.ts","webpack:///./src/app/cardtypes/multigraphcard/multigraphcard.html","webpack:///./src/app/cardtypes/textboxcard/textboxcard.component.html","webpack:///./src/app/cardtypes/textboxcard/textboxcard.component.ts","webpack:///./src/app/clinicalconcepts/bch-microbio-code.ts","webpack:///./src/app/clinicalconcepts/display-grouping.ts","webpack:///./src/app/clinicalconcepts/loinc-code.ts","webpack:///./src/app/clinicalconcepts/resource-code-group.ts","webpack:///./src/app/clinicalconcepts/resource-code-manager-exports.ts","webpack:///./src/app/clinicalconcepts/resource-code-manager.ts","webpack:///./src/app/clinicalconcepts/rx-norm-group.ts","webpack:///./src/app/clinicalconcepts/rx-norm.ts","webpack:///./src/app/confirm-save/confirm-save.component.css","webpack:///./src/app/confirm-save/confirm-save.component.html","webpack:///./src/app/confirm-save/confirm-save.component.ts","webpack:///./src/app/data-selector-element/data-selector-element.component.css","webpack:///./src/app/data-selector-element/data-selector-element.component.html","webpack:///./src/app/data-selector-element/data-selector-element.component.ts","webpack:///./src/app/data-selector-menu/data-selector-menu.component.css","webpack:///./src/app/data-selector-menu/data-selector-menu.component.html","webpack:///./src/app/data-selector-menu/data-selector-menu.component.ts","webpack:///./src/app/date_utils.ts","webpack:///./src/app/debugger.service.ts","webpack:///./src/app/debugger/debugger.component.html","webpack:///./src/app/debugger/debugger.component.ts","webpack:///./src/app/delete-dialog/delete-dialog.component.html","webpack:///./src/app/delete-dialog/delete-dialog.component.ts","webpack:///./src/app/fhir-data-classes/annotated-diagnotic-report.ts","webpack:///./src/app/fhir-data-classes/annotated-observation.ts","webpack:///./src/app/fhir-data-classes/diagnostic-report.ts","webpack:///./src/app/fhir-data-classes/dosage.ts","webpack:///./src/app/fhir-data-classes/encounter.ts","webpack:///./src/app/fhir-data-classes/medication-administration.ts","webpack:///./src/app/fhir-data-classes/medication-order.ts","webpack:///./src/app/fhir-data-classes/medication.ts","webpack:///./src/app/fhir-data-classes/observation-interpretation-valueset.ts","webpack:///./src/app/fhir-data-classes/observation-set.ts","webpack:///./src/app/fhir-data-classes/observation.ts","webpack:///./src/app/fhir-data-classes/specimen.ts","webpack:///./src/app/fhir-http.service.ts","webpack:///./src/app/fhir-launch/fhir-launch.component.css","webpack:///./src/app/fhir-launch/fhir-launch.component.html","webpack:///./src/app/fhir-launch/fhir-launch.component.ts","webpack:///./src/app/fhir-resource-set.ts","webpack:///./src/app/fhir.service.ts","webpack:///./src/app/graphdatatypes/customizabledata.ts","webpack:///./src/app/graphdatatypes/graphdata.ts","webpack:///./src/app/graphdatatypes/labeled-series.ts","webpack:///./src/app/graphdatatypes/linegraphdata.ts","webpack:///./src/app/graphdatatypes/microbiographdata.ts","webpack:///./src/app/graphdatatypes/stepgraphdata.ts","webpack:///./src/app/graphtypes/axis-group.ts","webpack:///./src/app/graphtypes/axis.ts","webpack:///./src/app/graphtypes/customizable-graph/customizable-graph-annotation.ts","webpack:///./src/app/graphtypes/customizable-graph/customizable-graph.component.ts","webpack:///./src/app/graphtypes/graph.css","webpack:///./src/app/graphtypes/graph/graph.component.html","webpack:///./src/app/graphtypes/graph/graph.component.ts","webpack:///./src/app/graphtypes/legend-info.ts","webpack:///./src/app/graphtypes/linegraph/linegraph.component.ts","webpack:///./src/app/graphtypes/microbio-graph/microbio-graph.component.ts","webpack:///./src/app/graphtypes/scatterplot/scatterplot.component.ts","webpack:///./src/app/graphtypes/stepgraph/stepgraph.component.ts","webpack:///./src/app/graphtypes/tooltips/medication-tooltips.ts","webpack:///./src/app/graphtypes/tooltips/microbio-tooltips.ts","webpack:///./src/app/graphtypes/tooltips/observation-tooltips.ts","webpack:///./src/app/graphtypes/tooltips/tooltip.ts","webpack:///./src/app/help-dialog/help-dialog.component.css","webpack:///./src/app/help-dialog/help-dialog.component.html","webpack:///./src/app/help-dialog/help-dialog.component.ts","webpack:///./src/app/ifu-dialog/ifu-dialog.component.css","webpack:///./src/app/ifu-dialog/ifu-dialog.component.html","webpack:///./src/app/ifu-dialog/ifu-dialog.component.ts","webpack:///./src/app/mock-fhir.service.ts","webpack:///./src/app/result-error.ts","webpack:///./src/app/setup-data.service.ts","webpack:///./src/app/setup/setup.component.css","webpack:///./src/app/setup/setup.component.html","webpack:///./src/app/setup/setup.component.ts","webpack:///./src/app/smart-on-fhir-client.ts","webpack:///./src/app/theme/verily_colors.ts","webpack:///./src/app/timeline-controller/timeline-controller.component.css","webpack:///./src/app/timeline-controller/timeline-controller.component.html","webpack:///./src/app/timeline-controller/timeline-controller.component.ts","webpack:///./src/app/timeline-toolbar/timeline-toolbar.component.html","webpack:///./src/app/timeline-toolbar/timeline-toolbar.component.ts","webpack:///./src/app/unit_utils.ts","webpack:///./src/constants.ts","webpack:///./src/environments/environment.ts","webpack:///./src/main.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6E;;;;;;;;;;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;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oDAAoD;QACpD,sEAAsE;QACtE,kBAAkB,GAAG,0DAAoB,GAAG,cAAc,CAAC,CAAC;CACjE;KAAM;IACL,uEAAuE;IACvE,wCAAwC;IACxC,QAAQ,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;CACxD;AAED,gGAAsB,EAAE,CAAC,eAAe,CAAC,yDAAS,CAAC,CAAC,KAAK,CACrD,aAAG,IAAI,cAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAhB,CAAgB,CAAC,CAAC","file":"main.js","sourcesContent":["var map = {\n\t\"./af\": \"./node_modules/moment/locale/af.js\",\n\t\"./af.js\": \"./node_modules/moment/locale/af.js\",\n\t\"./ar\": \"./node_modules/moment/locale/ar.js\",\n\t\"./ar-dz\": \"./node_modules/moment/locale/ar-dz.js\",\n\t\"./ar-dz.js\": \"./node_modules/moment/locale/ar-dz.js\",\n\t\"./ar-kw\": \"./node_modules/moment/locale/ar-kw.js\",\n\t\"./ar-kw.js\": \"./node_modules/moment/locale/ar-kw.js\",\n\t\"./ar-ly\": \"./node_modules/moment/locale/ar-ly.js\",\n\t\"./ar-ly.js\": \"./node_modules/moment/locale/ar-ly.js\",\n\t\"./ar-ma\": \"./node_modules/moment/locale/ar-ma.js\",\n\t\"./ar-ma.js\": \"./node_modules/moment/locale/ar-ma.js\",\n\t\"./ar-sa\": \"./node_modules/moment/locale/ar-sa.js\",\n\t\"./ar-sa.js\": \"./node_modules/moment/locale/ar-sa.js\",\n\t\"./ar-tn\": \"./node_modules/moment/locale/ar-tn.js\",\n\t\"./ar-tn.js\": \"./node_modules/moment/locale/ar-tn.js\",\n\t\"./ar.js\": \"./node_modules/moment/locale/ar.js\",\n\t\"./az\": \"./node_modules/moment/locale/az.js\",\n\t\"./az.js\": \"./node_modules/moment/locale/az.js\",\n\t\"./be\": \"./node_modules/moment/locale/be.js\",\n\t\"./be.js\": \"./node_modules/moment/locale/be.js\",\n\t\"./bg\": \"./node_modules/moment/locale/bg.js\",\n\t\"./bg.js\": \"./node_modules/moment/locale/bg.js\",\n\t\"./bm\": \"./node_modules/moment/locale/bm.js\",\n\t\"./bm.js\": \"./node_modules/moment/locale/bm.js\",\n\t\"./bn\": \"./node_modules/moment/locale/bn.js\",\n\t\"./bn.js\": \"./node_modules/moment/locale/bn.js\",\n\t\"./bo\": \"./node_modules/moment/locale/bo.js\",\n\t\"./bo.js\": \"./node_modules/moment/locale/bo.js\",\n\t\"./br\": \"./node_modules/moment/locale/br.js\",\n\t\"./br.js\": \"./node_modules/moment/locale/br.js\",\n\t\"./bs\": \"./node_modules/moment/locale/bs.js\",\n\t\"./bs.js\": \"./node_modules/moment/locale/bs.js\",\n\t\"./ca\": \"./node_modules/moment/locale/ca.js\",\n\t\"./ca.js\": \"./node_modules/moment/locale/ca.js\",\n\t\"./cs\": \"./node_modules/moment/locale/cs.js\",\n\t\"./cs.js\": \"./node_modules/moment/locale/cs.js\",\n\t\"./cv\": \"./node_modules/moment/locale/cv.js\",\n\t\"./cv.js\": \"./node_modules/moment/locale/cv.js\",\n\t\"./cy\": \"./node_modules/moment/locale/cy.js\",\n\t\"./cy.js\": \"./node_modules/moment/locale/cy.js\",\n\t\"./da\": \"./node_modules/moment/locale/da.js\",\n\t\"./da.js\": \"./node_modules/moment/locale/da.js\",\n\t\"./de\": \"./node_modules/moment/locale/de.js\",\n\t\"./de-at\": \"./node_modules/moment/locale/de-at.js\",\n\t\"./de-at.js\": \"./node_modules/moment/locale/de-at.js\",\n\t\"./de-ch\": \"./node_modules/moment/locale/de-ch.js\",\n\t\"./de-ch.js\": \"./node_modules/moment/locale/de-ch.js\",\n\t\"./de.js\": \"./node_modules/moment/locale/de.js\",\n\t\"./dv\": \"./node_modules/moment/locale/dv.js\",\n\t\"./dv.js\": \"./node_modules/moment/locale/dv.js\",\n\t\"./el\": \"./node_modules/moment/locale/el.js\",\n\t\"./el.js\": \"./node_modules/moment/locale/el.js\",\n\t\"./en-au\": \"./node_modules/moment/locale/en-au.js\",\n\t\"./en-au.js\": \"./node_modules/moment/locale/en-au.js\",\n\t\"./en-ca\": \"./node_modules/moment/locale/en-ca.js\",\n\t\"./en-ca.js\": \"./node_modules/moment/locale/en-ca.js\",\n\t\"./en-gb\": \"./node_modules/moment/locale/en-gb.js\",\n\t\"./en-gb.js\": \"./node_modules/moment/locale/en-gb.js\",\n\t\"./en-ie\": \"./node_modules/moment/locale/en-ie.js\",\n\t\"./en-ie.js\": \"./node_modules/moment/locale/en-ie.js\",\n\t\"./en-il\": \"./node_modules/moment/locale/en-il.js\",\n\t\"./en-il.js\": \"./node_modules/moment/locale/en-il.js\",\n\t\"./en-nz\": \"./node_modules/moment/locale/en-nz.js\",\n\t\"./en-nz.js\": \"./node_modules/moment/locale/en-nz.js\",\n\t\"./eo\": \"./node_modules/moment/locale/eo.js\",\n\t\"./eo.js\": \"./node_modules/moment/locale/eo.js\",\n\t\"./es\": \"./node_modules/moment/locale/es.js\",\n\t\"./es-do\": \"./node_modules/moment/locale/es-do.js\",\n\t\"./es-do.js\": \"./node_modules/moment/locale/es-do.js\",\n\t\"./es-us\": \"./node_modules/moment/locale/es-us.js\",\n\t\"./es-us.js\": \"./node_modules/moment/locale/es-us.js\",\n\t\"./es.js\": \"./node_modules/moment/locale/es.js\",\n\t\"./et\": \"./node_modules/moment/locale/et.js\",\n\t\"./et.js\": \"./node_modules/moment/locale/et.js\",\n\t\"./eu\": \"./node_modules/moment/locale/eu.js\",\n\t\"./eu.js\": \"./node_modules/moment/locale/eu.js\",\n\t\"./fa\": \"./node_modules/moment/locale/fa.js\",\n\t\"./fa.js\": \"./node_modules/moment/locale/fa.js\",\n\t\"./fi\": \"./node_modules/moment/locale/fi.js\",\n\t\"./fi.js\": \"./node_modules/moment/locale/fi.js\",\n\t\"./fo\": \"./node_modules/moment/locale/fo.js\",\n\t\"./fo.js\": \"./node_modules/moment/locale/fo.js\",\n\t\"./fr\": \"./node_modules/moment/locale/fr.js\",\n\t\"./fr-ca\": \"./node_modules/moment/locale/fr-ca.js\",\n\t\"./fr-ca.js\": \"./node_modules/moment/locale/fr-ca.js\",\n\t\"./fr-ch\": \"./node_modules/moment/locale/fr-ch.js\",\n\t\"./fr-ch.js\": \"./node_modules/moment/locale/fr-ch.js\",\n\t\"./fr.js\": \"./node_modules/moment/locale/fr.js\",\n\t\"./fy\": \"./node_modules/moment/locale/fy.js\",\n\t\"./fy.js\": \"./node_modules/moment/locale/fy.js\",\n\t\"./gd\": \"./node_modules/moment/locale/gd.js\",\n\t\"./gd.js\": \"./node_modules/moment/locale/gd.js\",\n\t\"./gl\": \"./node_modules/moment/locale/gl.js\",\n\t\"./gl.js\": \"./node_modules/moment/locale/gl.js\",\n\t\"./gom-latn\": \"./node_modules/moment/locale/gom-latn.js\",\n\t\"./gom-latn.js\": \"./node_modules/moment/locale/gom-latn.js\",\n\t\"./gu\": \"./node_modules/moment/locale/gu.js\",\n\t\"./gu.js\": \"./node_modules/moment/locale/gu.js\",\n\t\"./he\": \"./node_modules/moment/locale/he.js\",\n\t\"./he.js\": \"./node_modules/moment/locale/he.js\",\n\t\"./hi\": \"./node_modules/moment/locale/hi.js\",\n\t\"./hi.js\": \"./node_modules/moment/locale/hi.js\",\n\t\"./hr\": \"./node_modules/moment/locale/hr.js\",\n\t\"./hr.js\": \"./node_modules/moment/locale/hr.js\",\n\t\"./hu\": \"./node_modules/moment/locale/hu.js\",\n\t\"./hu.js\": \"./node_modules/moment/locale/hu.js\",\n\t\"./hy-am\": \"./node_modules/moment/locale/hy-am.js\",\n\t\"./hy-am.js\": \"./node_modules/moment/locale/hy-am.js\",\n\t\"./id\": \"./node_modules/moment/locale/id.js\",\n\t\"./id.js\": \"./node_modules/moment/locale/id.js\",\n\t\"./is\": \"./node_modules/moment/locale/is.js\",\n\t\"./is.js\": \"./node_modules/moment/locale/is.js\",\n\t\"./it\": \"./node_modules/moment/locale/it.js\",\n\t\"./it.js\": \"./node_modules/moment/locale/it.js\",\n\t\"./ja\": \"./node_modules/moment/locale/ja.js\",\n\t\"./ja.js\": \"./node_modules/moment/locale/ja.js\",\n\t\"./jv\": \"./node_modules/moment/locale/jv.js\",\n\t\"./jv.js\": \"./node_modules/moment/locale/jv.js\",\n\t\"./ka\": \"./node_modules/moment/locale/ka.js\",\n\t\"./ka.js\": \"./node_modules/moment/locale/ka.js\",\n\t\"./kk\": \"./node_modules/moment/locale/kk.js\",\n\t\"./kk.js\": \"./node_modules/moment/locale/kk.js\",\n\t\"./km\": \"./node_modules/moment/locale/km.js\",\n\t\"./km.js\": \"./node_modules/moment/locale/km.js\",\n\t\"./kn\": \"./node_modules/moment/locale/kn.js\",\n\t\"./kn.js\": \"./node_modules/moment/locale/kn.js\",\n\t\"./ko\": \"./node_modules/moment/locale/ko.js\",\n\t\"./ko.js\": \"./node_modules/moment/locale/ko.js\",\n\t\"./ku\": \"./node_modules/moment/locale/ku.js\",\n\t\"./ku.js\": \"./node_modules/moment/locale/ku.js\",\n\t\"./ky\": \"./node_modules/moment/locale/ky.js\",\n\t\"./ky.js\": \"./node_modules/moment/locale/ky.js\",\n\t\"./lb\": \"./node_modules/moment/locale/lb.js\",\n\t\"./lb.js\": \"./node_modules/moment/locale/lb.js\",\n\t\"./lo\": \"./node_modules/moment/locale/lo.js\",\n\t\"./lo.js\": \"./node_modules/moment/locale/lo.js\",\n\t\"./lt\": \"./node_modules/moment/locale/lt.js\",\n\t\"./lt.js\": \"./node_modules/moment/locale/lt.js\",\n\t\"./lv\": \"./node_modules/moment/locale/lv.js\",\n\t\"./lv.js\": \"./node_modules/moment/locale/lv.js\",\n\t\"./me\": \"./node_modules/moment/locale/me.js\",\n\t\"./me.js\": \"./node_modules/moment/locale/me.js\",\n\t\"./mi\": \"./node_modules/moment/locale/mi.js\",\n\t\"./mi.js\": \"./node_modules/moment/locale/mi.js\",\n\t\"./mk\": \"./node_modules/moment/locale/mk.js\",\n\t\"./mk.js\": \"./node_modules/moment/locale/mk.js\",\n\t\"./ml\": \"./node_modules/moment/locale/ml.js\",\n\t\"./ml.js\": \"./node_modules/moment/locale/ml.js\",\n\t\"./mn\": \"./node_modules/moment/locale/mn.js\",\n\t\"./mn.js\": \"./node_modules/moment/locale/mn.js\",\n\t\"./mr\": \"./node_modules/moment/locale/mr.js\",\n\t\"./mr.js\": \"./node_modules/moment/locale/mr.js\",\n\t\"./ms\": \"./node_modules/moment/locale/ms.js\",\n\t\"./ms-my\": \"./node_modules/moment/locale/ms-my.js\",\n\t\"./ms-my.js\": \"./node_modules/moment/locale/ms-my.js\",\n\t\"./ms.js\": \"./node_modules/moment/locale/ms.js\",\n\t\"./mt\": \"./node_modules/moment/locale/mt.js\",\n\t\"./mt.js\": \"./node_modules/moment/locale/mt.js\",\n\t\"./my\": \"./node_modules/moment/locale/my.js\",\n\t\"./my.js\": \"./node_modules/moment/locale/my.js\",\n\t\"./nb\": \"./node_modules/moment/locale/nb.js\",\n\t\"./nb.js\": \"./node_modules/moment/locale/nb.js\",\n\t\"./ne\": \"./node_modules/moment/locale/ne.js\",\n\t\"./ne.js\": \"./node_modules/moment/locale/ne.js\",\n\t\"./nl\": \"./node_modules/moment/locale/nl.js\",\n\t\"./nl-be\": \"./node_modules/moment/locale/nl-be.js\",\n\t\"./nl-be.js\": \"./node_modules/moment/locale/nl-be.js\",\n\t\"./nl.js\": \"./node_modules/moment/locale/nl.js\",\n\t\"./nn\": \"./node_modules/moment/locale/nn.js\",\n\t\"./nn.js\": \"./node_modules/moment/locale/nn.js\",\n\t\"./pa-in\": \"./node_modules/moment/locale/pa-in.js\",\n\t\"./pa-in.js\": \"./node_modules/moment/locale/pa-in.js\",\n\t\"./pl\": \"./node_modules/moment/locale/pl.js\",\n\t\"./pl.js\": \"./node_modules/moment/locale/pl.js\",\n\t\"./pt\": \"./node_modules/moment/locale/pt.js\",\n\t\"./pt-br\": \"./node_modules/moment/locale/pt-br.js\",\n\t\"./pt-br.js\": \"./node_modules/moment/locale/pt-br.js\",\n\t\"./pt.js\": \"./node_modules/moment/locale/pt.js\",\n\t\"./ro\": \"./node_modules/moment/locale/ro.js\",\n\t\"./ro.js\": \"./node_modules/moment/locale/ro.js\",\n\t\"./ru\": \"./node_modules/moment/locale/ru.js\",\n\t\"./ru.js\": \"./node_modules/moment/locale/ru.js\",\n\t\"./sd\": \"./node_modules/moment/locale/sd.js\",\n\t\"./sd.js\": \"./node_modules/moment/locale/sd.js\",\n\t\"./se\": \"./node_modules/moment/locale/se.js\",\n\t\"./se.js\": \"./node_modules/moment/locale/se.js\",\n\t\"./si\": \"./node_modules/moment/locale/si.js\",\n\t\"./si.js\": \"./node_modules/moment/locale/si.js\",\n\t\"./sk\": \"./node_modules/moment/locale/sk.js\",\n\t\"./sk.js\": \"./node_modules/moment/locale/sk.js\",\n\t\"./sl\": \"./node_modules/moment/locale/sl.js\",\n\t\"./sl.js\": \"./node_modules/moment/locale/sl.js\",\n\t\"./sq\": \"./node_modules/moment/locale/sq.js\",\n\t\"./sq.js\": \"./node_modules/moment/locale/sq.js\",\n\t\"./sr\": \"./node_modules/moment/locale/sr.js\",\n\t\"./sr-cyrl\": \"./node_modules/moment/locale/sr-cyrl.js\",\n\t\"./sr-cyrl.js\": \"./node_modules/moment/locale/sr-cyrl.js\",\n\t\"./sr.js\": \"./node_modules/moment/locale/sr.js\",\n\t\"./ss\": \"./node_modules/moment/locale/ss.js\",\n\t\"./ss.js\": \"./node_modules/moment/locale/ss.js\",\n\t\"./sv\": \"./node_modules/moment/locale/sv.js\",\n\t\"./sv.js\": \"./node_modules/moment/locale/sv.js\",\n\t\"./sw\": \"./node_modules/moment/locale/sw.js\",\n\t\"./sw.js\": \"./node_modules/moment/locale/sw.js\",\n\t\"./ta\": \"./node_modules/moment/locale/ta.js\",\n\t\"./ta.js\": \"./node_modules/moment/locale/ta.js\",\n\t\"./te\": \"./node_modules/moment/locale/te.js\",\n\t\"./te.js\": \"./node_modules/moment/locale/te.js\",\n\t\"./tet\": \"./node_modules/moment/locale/tet.js\",\n\t\"./tet.js\": \"./node_modules/moment/locale/tet.js\",\n\t\"./tg\": \"./node_modules/moment/locale/tg.js\",\n\t\"./tg.js\": \"./node_modules/moment/locale/tg.js\",\n\t\"./th\": \"./node_modules/moment/locale/th.js\",\n\t\"./th.js\": \"./node_modules/moment/locale/th.js\",\n\t\"./tl-ph\": \"./node_modules/moment/locale/tl-ph.js\",\n\t\"./tl-ph.js\": \"./node_modules/moment/locale/tl-ph.js\",\n\t\"./tlh\": \"./node_modules/moment/locale/tlh.js\",\n\t\"./tlh.js\": \"./node_modules/moment/locale/tlh.js\",\n\t\"./tr\": \"./node_modules/moment/locale/tr.js\",\n\t\"./tr.js\": \"./node_modules/moment/locale/tr.js\",\n\t\"./tzl\": \"./node_modules/moment/locale/tzl.js\",\n\t\"./tzl.js\": \"./node_modules/moment/locale/tzl.js\",\n\t\"./tzm\": \"./node_modules/moment/locale/tzm.js\",\n\t\"./tzm-latn\": \"./node_modules/moment/locale/tzm-latn.js\",\n\t\"./tzm-latn.js\": \"./node_modules/moment/locale/tzm-latn.js\",\n\t\"./tzm.js\": \"./node_modules/moment/locale/tzm.js\",\n\t\"./ug-cn\": \"./node_modules/moment/locale/ug-cn.js\",\n\t\"./ug-cn.js\": \"./node_modules/moment/locale/ug-cn.js\",\n\t\"./uk\": \"./node_modules/moment/locale/uk.js\",\n\t\"./uk.js\": \"./node_modules/moment/locale/uk.js\",\n\t\"./ur\": \"./node_modules/moment/locale/ur.js\",\n\t\"./ur.js\": \"./node_modules/moment/locale/ur.js\",\n\t\"./uz\": \"./node_modules/moment/locale/uz.js\",\n\t\"./uz-latn\": \"./node_modules/moment/locale/uz-latn.js\",\n\t\"./uz-latn.js\": \"./node_modules/moment/locale/uz-latn.js\",\n\t\"./uz.js\": \"./node_modules/moment/locale/uz.js\",\n\t\"./vi\": \"./node_modules/moment/locale/vi.js\",\n\t\"./vi.js\": \"./node_modules/moment/locale/vi.js\",\n\t\"./x-pseudo\": \"./node_modules/moment/locale/x-pseudo.js\",\n\t\"./x-pseudo.js\": \"./node_modules/moment/locale/x-pseudo.js\",\n\t\"./yo\": \"./node_modules/moment/locale/yo.js\",\n\t\"./yo.js\": \"./node_modules/moment/locale/yo.js\",\n\t\"./zh-cn\": \"./node_modules/moment/locale/zh-cn.js\",\n\t\"./zh-cn.js\": \"./node_modules/moment/locale/zh-cn.js\",\n\t\"./zh-hk\": \"./node_modules/moment/locale/zh-hk.js\",\n\t\"./zh-hk.js\": \"./node_modules/moment/locale/zh-hk.js\",\n\t\"./zh-tw\": \"./node_modules/moment/locale/zh-tw.js\",\n\t\"./zh-tw.js\": \"./node_modules/moment/locale/zh-tw.js\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) { // check for number or string\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn id;\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./node_modules/moment/locale sync recursive ^\\\\.\\\\/.*$\";","function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncaught exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"./src/$$_lazy_route_resource lazy recursive\";","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\n\nimport {CardcontainerComponent} from './cardcontainer/cardcontainer.component';\nimport {FhirLaunchComponent} from './fhir-launch/fhir-launch.component';\nimport {SetupComponent} from './setup/setup.component';\n\n/* On their end, it's locked down so that the only acceptable redirect\nURL is localhost:8000/. So, we have to do a different path for\nauthentication. */\nconst routes: Routes = [\n {path: 'main', component: CardcontainerComponent},\n {path: 'setup', component: SetupComponent},\n {path: '', component: FhirLaunchComponent}, {path: '**', redirectTo: ''}\n];\n\n\n@NgModule({exports: [RouterModule], imports: [RouterModule.forRoot(routes)]})\n\nexport class AppRoutingModule {\n}\n","module.exports = \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2FwcC5jb21wb25lbnQuY3NzIn0= */\"","module.exports = \"\\n\\nMedTimeLine\\n\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component} from '@angular/core';\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n title = 'app';\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport 'fhirclient';\n\nimport {HttpClientModule} from '@angular/common/http';\nimport {NgModule} from '@angular/core';\nimport {FlexLayoutModule} from '@angular/flex-layout';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\n// tslint:disable-next-line:max-line-length\nimport {MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatCheckboxModule, MatDatepickerModule, MatDialogModule, MatDividerModule, MatExpansionModule, MatListModule, MatMenuModule, MatNativeDateModule, MatProgressSpinnerModule, MatRadioModule, MatSnackBarModule, MatStepperModule, MatToolbarModule, MatTooltipModule} from '@angular/material';\nimport {MatCardModule} from '@angular/material/card';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatInputModule} from '@angular/material/input';\nimport {BrowserModule} from '@angular/platform-browser';\nimport {NoopAnimationsModule} from '@angular/platform-browser/animations';\nimport {NgbModule} from '@ng-bootstrap/ng-bootstrap';\nimport {ChartsModule} from 'ng2-charts';\nimport {DragulaModule} from 'ng2-dragula';\nimport {NgxDaterangepickerMd} from 'ngx-daterangepicker-material';\nimport {UI_CONSTANTS, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {environment} from '../environments/environment';\n\nimport {AppRoutingModule} from './app-routing.module';\nimport {AppComponent} from './app.component';\nimport {CardcontainerComponent} from './cardcontainer/cardcontainer.component';\nimport {CardComponent} from './cardtypes/card/card.component';\n// tslint:disable-next-line:max-line-length\nimport {CustomizableTimelineDialogComponent} from './cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component';\nimport {CustomizableTimelineComponent} from './cardtypes/customizable-timeline/customizable-timeline.component';\nimport {MultiGraphCardComponent} from './cardtypes/multigraphcard/multigraphcard.component';\nimport {TextboxcardComponent} from './cardtypes/textboxcard/textboxcard.component';\nimport {ResourceCodeManager} from './clinicalconcepts/resource-code-manager';\nimport {ConfirmSaveComponent} from './confirm-save/confirm-save.component';\nimport {DataSelectorElementComponent} from './data-selector-element/data-selector-element.component';\nimport {DataSelectorMenuComponent} from './data-selector-menu/data-selector-menu.component';\nimport {DebuggerComponent} from './debugger/debugger.component';\nimport {DeleteDialogComponent} from './delete-dialog/delete-dialog.component';\nimport {FhirHttpService} from './fhir-http.service';\nimport {FhirLaunchComponent} from './fhir-launch/fhir-launch.component';\nimport {FhirService} from './fhir.service';\nimport {CustomizableGraphComponent} from './graphtypes/customizable-graph/customizable-graph.component';\nimport {LineGraphComponent} from './graphtypes/linegraph/linegraph.component';\nimport {MicrobioGraphComponent} from './graphtypes/microbio-graph/microbio-graph.component';\nimport {ScatterplotComponent} from './graphtypes/scatterplot/scatterplot.component';\nimport {StepGraphComponent} from './graphtypes/stepgraph/stepgraph.component';\nimport {HelpDialogComponent} from './help-dialog/help-dialog.component';\nimport {IfuDialogComponent} from './ifu-dialog/ifu-dialog.component';\nimport {MockFhirService} from './mock-fhir.service';\nimport {SetupComponent} from './setup/setup.component';\nimport {SMART_ON_FHIR_CLIENT} from './smart-on-fhir-client';\nimport {TimelineControllerComponent} from './timeline-controller/timeline-controller.component';\nimport {TimelineToolbarComponent} from './timeline-toolbar/timeline-toolbar.component';\n\n@NgModule({\n declarations: [\n AppComponent,\n FhirLaunchComponent,\n CardcontainerComponent,\n TextboxcardComponent,\n LineGraphComponent,\n ScatterplotComponent,\n StepGraphComponent,\n MultiGraphCardComponent,\n TimelineControllerComponent,\n CustomizableTimelineComponent,\n CustomizableGraphComponent,\n CustomizableTimelineDialogComponent,\n MicrobioGraphComponent,\n TimelineToolbarComponent,\n DataSelectorElementComponent,\n DataSelectorMenuComponent,\n HelpDialogComponent,\n CardComponent,\n DeleteDialogComponent,\n DebuggerComponent,\n SetupComponent,\n ConfirmSaveComponent,\n IfuDialogComponent,\n ],\n imports: [\n BrowserModule,\n NgbModule,\n MatCardModule,\n HttpClientModule,\n MatListModule,\n MatDividerModule,\n MatIconModule,\n NoopAnimationsModule,\n FormsModule,\n ReactiveFormsModule,\n MatInputModule,\n MatProgressSpinnerModule,\n MatButtonModule,\n MatAutocompleteModule,\n MatMenuModule,\n MatTooltipModule,\n FlexLayoutModule.withConfig({useColumnBasisZero: false}),\n MatDialogModule,\n MatStepperModule,\n MatToolbarModule,\n MatSnackBarModule,\n MatDatepickerModule,\n NgxDaterangepickerMd.forRoot({}),\n MatButtonToggleModule,\n MatNativeDateModule,\n MatCheckboxModule,\n MatRadioModule,\n ChartsModule,\n DragulaModule.forRoot(),\n AppRoutingModule,\n MatExpansionModule\n ],\n providers: [\n // This sets up a provider for the smart on fhir client defined by\n // assets/fhir-client.min.js (defined as symbol `FHIR`) so that it can be\n // injected into the service that uses it to allow for easier testing.\n {provide: SMART_ON_FHIR_CLIENT, useValue: FHIR}, {\n provide: FhirService,\n useClass: environment.useMockServer ? MockFhirService : FhirHttpService\n },\n {provide: ResourceCodeManager, useClass: ResourceCodeManager},\n {provide: UI_CONSTANTS_TOKEN, useValue: UI_CONSTANTS}\n ],\n bootstrap: [AppComponent],\n entryComponents: [\n CustomizableTimelineDialogComponent, HelpDialogComponent,\n DeleteDialogComponent, ConfirmSaveComponent, IfuDialogComponent\n ]\n})\nexport class AppModule {\n}\n","module.exports = \".cardContainer {\\n background-color: #202020; /* GREY_900 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n padding: 15px;\\n width: 100%;\\n min-height: 100%;\\n height: 100%;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n /* Disable selecting/highlighting on the page. */\\n -webkit-touch-callout: none; /* iOS Safari */\\n -webkit-user-select: none; /* Safari */\\n -moz-user-select: none; /* Firefox */\\n -ms-user-select: none; /* Internet Explorer/Edge */\\n user-select: none; /* Chrome and Opera */\\n}\\n\\n.draggable {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n height: 100%;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n}\\n\\n.flexSpacer {\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n}\\n\\n::ng-deep .mat-toolbar, .mat-toolbar h1, .mat-toolbar h2, .mat-toolbar h3, .mat-toolbar h4, .mat-toolbar h5, .mat-toolbar h6, .mat-toolbar-row, .mat-toolbar-single-row {\\n display: -ms-flexbox; /* For IE10 */\\n}\\n\\n.mat-toolbar {\\n /* Deep Purple 800 to Pink 900 */\\n background-image: -webkit-gradient(linear, left top, right top, from(#4527A0) , to(#870D4E));\\n background-image: linear-gradient(to right, #4527A0 , #870D4E);\\n color: white;\\n}\\n\\n::ng-deep .gu-unselectable app-data-selector-menu {\\n /* Hide the data selector menus while a card is being dragged. */\\n opacity: 0 !important;\\n}\\n\\n.makeGutters {\\n padding-right: 50px;\\n padding-left: 50px;\\n}\\n\\n::ng-deep .mat-toolbar-single-row {\\n white-space: unset !important;\\n}\\n\\n::ng-deep .timelineToolbarMain {\\n float: right;\\n margin-right: 15px;\\n display: -ms-flexbox; /* For IE10 */\\n}\\n\\n::ng-deep app-card {\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n flex-direction: row;\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n}\\n\\n::ng-deep app-data-selector-menu {\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n flex-direction: row;\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZGNvbnRhaW5lci9jYXJkY29udGFpbmVyLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSx5QkFBeUIsRUFBRSxhQUFhO0VBQ3hDLG9CQUFhO0VBQWIsYUFBYTtFQUNiLG9CQUFvQixFQUFFLGFBQWE7RUFDbkMsYUFBYTtFQUNiLFdBQVc7RUFDWCxnQkFBZ0I7RUFDaEIsWUFBWTtFQUNaLDRCQUFzQjtFQUF0Qiw2QkFBc0I7VUFBdEIsc0JBQXNCLEVBQ00sYUFBYTtFQUN6QyxnREFBZ0Q7RUFDaEQsMkJBQTJCLEVBQUUsZUFBZTtFQUM1Qyx5QkFBeUIsRUFBRSxXQUFXO0tBQ25DLHNCQUFzQixFQUFFLFlBQVk7TUFDbkMscUJBQXFCLEVBQUUsMkJBQTJCO1VBQzlDLGlCQUFpQixFQUFFLHFCQUFxQjtBQUNsRDs7QUFFQTtFQUNFLG9CQUFhO0VBQWIsYUFBYTtFQUNiLG9CQUFvQjtFQUNwQixZQUFZO0VBQ1osNEJBQXNCO0VBQXRCLDZC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BkaXNwbGF5OiBmbGV4O1xuICBkaXNwbGF5OiAtbXMtZmxleGJveDsgLyogRm9yIElFMTAgKi9cbn1cbiJdfQ== */\"","module.exports = \"\\n \\n \\n \\n
\\n \\n \\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n \\n \\n \\n \\n \\n \\n
\\n
\\n \\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, Inject} from '@angular/core';\nimport {MatDialog, MatDialogRef, MatSnackBar} from '@angular/material';\nimport html2canvas from 'html2canvas';\nimport {DateTime, Interval} from 'luxon';\nimport {DragulaService} from 'ng2-dragula';\nimport {Subscription} from 'rxjs';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\nimport {v4 as uuid} from 'uuid';\n\nimport {environment} from '../../environments/environment';\nimport {ResourceCodeManager} from '../clinicalconcepts/resource-code-manager';\nimport {ConfirmSaveComponent} from '../confirm-save/confirm-save.component';\nimport {DeleteDialogComponent} from '../delete-dialog/delete-dialog.component';\nimport {FhirService} from '../fhir.service';\nimport {CustomizableData} from '../graphdatatypes/customizabledata';\nimport {AxisGroup} from '../graphtypes/axis-group';\nimport {ChartType} from '../graphtypes/graph/graph.component';\nimport {SetupDataService} from '../setup-data.service';\n\n@Component({\n selector: 'app-cardcontainer',\n templateUrl: './cardcontainer.component.html',\n styleUrls: ['./cardcontainer.component.css'],\n entryComponents: [DeleteDialogComponent],\n})\nexport class CardcontainerComponent {\n // How long to display the snack bar for.\n private readonly DISPLAY_TIME = 6000;\n\n // Whether or not to display the debugger.\n useDebugger = environment.useDebugger;\n\n /**\n * The format of each object in the array is an object representing a line\n * drawn on the chart, that has a value, text, and class field. The value\n * field represents the x-position of the line to be drawn, while the class\n * represents the class name, and the text represents the text displayed near\n * the line.\n */\n eventlines: Array<{[key: string]: number | string}> = [];\n\n // The concepts that are actually being displayed on the page.\n // We keep track of unique ids for each displayed card, to allow removal on\n // clicking the trashcan icon.\n\n readonly displayedConcepts:\n Array<{[key: string]: AxisGroup | string | CustomizableData}> = [];\n\n // The original concepts to duplicate, if necessary.\n readonly originalConcepts: AxisGroup[];\n\n // Hold an instance of this enum so that the HTML template can access it.\n readonly chartType = ChartType;\n\n /**\n * By default make the date range displayed the past seven days.\n */\n dateRange: Interval =\n Interval.fromDateTimes(DateTime.utc().minus({days: 7}), DateTime.utc());\n\n // Holds a subscription to the observable sequence of events emitted by the\n // Dragula Service.\n private readonly subs = new Subscription();\n\n // Holds the most recently removed card from the container, mapping the index\n // of the displayed card to the displayedConcept value.\n private recentlyRemoved:\n [number, {[key: string]: AxisGroup | string | CustomizableData}];\n\n // The reference for the Delete Card Dialog opened.\n private deleteDialogRef: MatDialogRef;\n\n // The reference for the Save Snapshot Dialog opened.\n private saveDialogRef: MatDialogRef;\n\n // A map of custom timeline id to the event lines corresponding to that\n // timeline.\n private eventsForCustomTimelines =\n new Map>();\n\n constructor(\n dragulaService: DragulaService,\n private fhirService: FhirService,\n resourceCodeManager: ResourceCodeManager,\n private snackBar: MatSnackBar,\n private deleteDialog: MatDialog,\n readonly setupDataService: SetupDataService,\n private saveDialog: MatDialog,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any,\n ) {\n const displayGroups = resourceCodeManager.getDisplayGroupMapping();\n /* Load in the concepts to display, flattening them all into a\n * single-depth array. */\n this.originalConcepts = Array.from(displayGroups.values())\n .reduce((acc, val) => acc.concat(val), []);\n this.setUpCards();\n this.setUpDrag(dragulaService);\n }\n\n private setUpCards() {\n // Add a textbox at the top of the card list.\n this.addTextbox();\n // Add a custom timeline to the top of the card list.\n this.addCustomTimeline();\n // Add all cards selected at the set-up screen.\n for (const concept of this.setupDataService.selectedConcepts) {\n this.displayedConcepts.push({'id': uuid(), 'concept': concept});\n }\n }\n\n // Ensures that the order of displayed concepts is updated as the user drags\n // cards around.\n private setUpDrag(dragulaService: DragulaService) {\n this.subs.add(dragulaService.drop('graphcards').subscribe((value) => {\n // Rearrange the order of this.displayedConcepts if graph/textbox\n // cards are reordered. We do not use dragulaModel since we cannot use\n // it for separate lists on the configuration panel.\n let originalIndex = this.displayedConcepts.map(x => x.id).indexOf(\n value.el.getAttribute('data-index'));\n const siblingIndex = this.getSiblingIdx(value);\n const elementDisplayed = this.displayedConcepts[originalIndex];\n // Add the element to its new position.\n this.displayedConcepts.splice(siblingIndex, 0, elementDisplayed);\n // Adjust the original position if needed.\n if (siblingIndex < originalIndex) {\n originalIndex++;\n }\n this.displayedConcepts.splice(originalIndex, 1);\n\n recordGoogleAnalyticsEvent(\n 'moveCard', 'moveCard',\n (typeof elementDisplayed === 'string') ?\n (elementDisplayed as string) :\n (elementDisplayed.label as string));\n }));\n }\n\n /**\n * Gets the index of the card below a dragged-and-dropped card's new place.\n */\n private getSiblingIdx(value): number {\n let siblingIndex;\n if (value.sibling === null) {\n // Dragged to bottom of list\n siblingIndex = this.displayedConcepts.length;\n } else {\n const siblingId = value.sibling.getAttribute('data-index');\n siblingIndex = this.displayedConcepts.map(x => x.id).indexOf(siblingId);\n }\n return siblingIndex;\n }\n\n /**\n * Adds a new annotation box to the card panel.\n * @param id: The id of the card above the position of the new annotation box.\n */\n addTextbox(id?: string) {\n const index =\n id ? (this.displayedConcepts.map(x => x.id).indexOf(id) + 1) : 0;\n this.displayedConcepts.splice(index, 0, {id: uuid(), concept: 'textbox'});\n }\n\n /**\n * Adds a new custom timeline to the card panel.\n * @param id: The id of the card above the position of the new annotation box.\n */\n addCustomTimeline(id?: string) {\n const index =\n id ? (this.displayedConcepts.map(x => x.id).indexOf(id) + 1) : 0;\n this.displayedConcepts.splice(\n index, 0, {id: uuid(), concept: 'customTimeline'});\n }\n\n // Listen for an event indicating that the date range has been changed on the\n // UI, and update the date range.\n changeDateRange($event) {\n this.dateRange = $event;\n }\n\n // Saves a snapshot of the graph drawer HTML to the EHR using a FhirService.\n snapshot() {\n html2canvas(document.body).then((canvas) => {\n this.saveDialogRef = this.saveDialog.open(\n ConfirmSaveComponent, {data: canvas, height: '80%'});\n\n this.saveDialogRef.afterClosed().subscribe(result => {\n // Only save the snapshot to the EHR if the user confirmed the save.\n if (result) {\n const date = DateTime.fromJSDate(new Date()).toISO();\n this.fhirService.saveStaticNote(canvas, date).then(res => {\n if (res) {\n this.snackBar.open(\n this.uiConstants.SAVED_TO_POWERCHART,\n this.uiConstants.DISMISS, {\n duration: this.DISPLAY_TIME, // Wait 6 seconds before\n // dismissing the snack bar.\n });\n } else {\n this.snackBar.open(\n this.uiConstants.ERROR_SAVED_TO_POWERCHART,\n this.uiConstants.DISMISS, {\n duration: this.DISPLAY_TIME, // Wait 6 seconds before\n // dismissing the snack bar.\n });\n }\n });\n\n\n recordGoogleAnalyticsEvent(\n 'saveStaticSnapshot', 'save', new Date().toDateString());\n }\n });\n });\n }\n\n // Listen for an event indicating that a \"delete\" button has been clicked on a\n // card currently displayed, and update the displayed concepts\n // accordingly after asking for confirmation of deletion.\n removeDisplayedCard($event) {\n const index = this.displayedConcepts.map(x => x.id).indexOf($event.id);\n const concept = this.displayedConcepts[index];\n concept.value = $event.value;\n this.deleteDialogRef = this.deleteDialog.open(DeleteDialogComponent);\n this.deleteDialogRef.afterClosed().subscribe(result => {\n // The user wishes to delete the card.\n if (result) {\n this.displayedConcepts.splice(index, 1);\n this.recentlyRemoved = [index, concept];\n this.openSnackBar();\n if (this.eventsForCustomTimelines.get($event.id)) {\n // We only remove the event lines for this CustomTimeline if the user\n // confirms the deletion of the card.\n this.updateEventLines({id: $event.id});\n }\n }\n });\n }\n\n // Open a snack bar allowing for the user to potentially reverse the removal\n // of cards from the page. Only one snack bar can be opened at a time.\n private openSnackBar() {\n const message = this.uiConstants.CARD_REMOVED;\n const snackBarRef = this.snackBar.open(message, this.uiConstants.UNDO, {\n duration:\n this.DISPLAY_TIME, // Wait 6 seconds before dismissing the snack bar.\n });\n // Undo the most recent deletion according to what is stored in\n // recentlyRemoved.\n snackBarRef.onAction().subscribe(() => {\n const index = this.recentlyRemoved[0];\n this.displayedConcepts.splice(index, 0, this.recentlyRemoved[1]);\n if (this.displayedConcepts[index].concept === 'customTimeline') {\n this.updateEventLines({\n id: this.displayedConcepts[0].id,\n data: this.displayedConcepts[0].value\n });\n }\n recordGoogleAnalyticsEvent(\n 'undoDelete', 'deleteCard',\n Array.from(this.recentlyRemoved.values()).toString());\n });\n }\n\n /**\n * Listens for an event indicating that the user has selected to add the\n * concept card from the top toolbar. The card is added at the top of the\n * page, or, if the id of the closest card is specified, below the closest\n * card.\n * @param label The label of the new concept to add.\n * @param id The id of the card below which to add the new concept.\n */\n\n addConceptCard(label: string, id?: string) {\n const graphCardValue =\n this.originalConcepts.find(obj => (obj.label === label));\n // Insert the card at the top of the page\n // Insert after the closest card rather than before the card.\n const index =\n id ? (this.displayedConcepts.map(x => x.id).indexOf(id) + 1) : 0;\n this.displayedConcepts.splice(\n index, 0, {id: uuid(), concept: graphCardValue});\n }\n\n /**\n * Listens for an event indicating that the user has edited the points on a\n * custom timeline, and updates the x-axis eventlines displayed on all other\n * charts.\n * @param $event The updated CustomizableData from which we calculate event\n * lines for each chart to display, along with the id of the updated.\n *\n */\n\n updateEventLines($event) {\n let times = [];\n if ($event.data) {\n times = Array.from($event.data.annotations.keys()).map(x => Number(x));\n }\n const eventlines = times.map(x => {\n return {\n value: x,\n text: $event.data.annotations.get(x).title,\n color: $event.data.annotations.get(x).color.hex()\n };\n });\n this.eventsForCustomTimelines.set($event.id, eventlines);\n\n // Consolidate all event lines from all custom timelines.\n let allEvents = [];\n for (const events of Array.from(this.eventsForCustomTimelines.values())) {\n allEvents = allEvents.concat(events);\n }\n this.eventlines = allEvents;\n }\n}\n","module.exports = \".mat-card {\\n cursor: -webkit-grab;\\n cursor: grab;\\n margin-top:0px;\\n margin-bottom:0px;\\n margin-left: 35px; /* Leave space for the \\\"add card\\\" button. */\\n padding-top: 0px;\\n padding-bottom: 0px;\\n padding-right: 20px;\\n padding-left: 0px;\\n -webkit-transition: box-shadow .1s;\\n transition: box-shadow .1s;\\n background-color: rgb(248, 248, 248);\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n flex-direction: row; /* For IE10 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n width: 100%;\\n max-width: 100%;\\n}\\n\\n::ng-deep .inEditMode .mat-card {\\n background-color: rgb(226, 226, 226) !important;\\n}\\n\\n.mat-card:hover {\\n background-color: rgb(240, 240, 240);\\n box-shadow: 0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36);\\n}\\n\\n.colorbar {\\n margin-right: 6px;\\n min-width: 24px;\\n border-top-left-radius: 4px;\\n border-bottom-left-radius: 4px;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-flex: 0;\\n flex: 0 0 0%;\\n -ms-flex: 0 0 0%; /* For IE10 */\\n align-content: center;\\n -ms-flex-line-pack: center; /* Align content: center conversion for IE10 */\\n -webkit-box-pack: center;\\n justify-content: center;\\n -ms-flex-pack: center; /* Justify content: center conversion for IE10 */\\n align-self: stretch;\\n -ms-flex-item-align: stretch; /* Align self: stretch conversion for IE10 */\\n}\\n\\n.mat-icon {\\n color: rgb(34, 44, 66);\\n cursor: pointer;\\n opacity: .3;\\n -webkit-transition: opacity .3s;\\n transition: opacity .3s;\\n}\\n\\n.removeCardButton {\\n opacity: 0;\\n}\\n\\n.mat-card:hover .mat-icon {\\n opacity: .8;\\n}\\n\\n.mat-card:hover .dragCardIcon.mat-icon {\\n opacity: .4;\\n}\\n\\n.dragCardIcon {\\n opacity: 0;\\n margin-bottom: 15px;\\n}\\n\\n.labelColumn {\\n padding: 3px;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-flex: 0;\\n flex: 0 0 auto;\\n -ms-flex: 0 0 auto; /* For IE10 */\\n}\\n\\n.label {\\n width: 100%;\\n word-wrap: break-word;\\n -webkit-box-flex: 1;\\n flex: 1 1 auto;\\n -ms-flex: 1 1 auto; /* For IE10 */\\n font-family: 'Montserrat', sans-serif;\\n}\\n\\n::ng-deep .mat-input-element:disabled{\\n color: rgb(0,0,0, .7) !important;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZHR5cGVzL2NhcmQvY2FyZC5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0Usb0JBQVk7RUFBWixZQUFZO0VBQ1osY0FBYztFQUNkLGlCQUFpQjtFQUNqQixpQkFBaUIsRUFBRSwyQ0FBMkM7RUFDOUQsZ0JBQWdCO0VBQ2hCLG1CQUFtQjtFQUNuQixtQkFBbUI7RUFDbkIsaUJBQWlCO0VBQ2pCLGtDQUEwQjtFQUExQiwwQkFBMEI7RUFDMUIsb0NBQW9DO0VBQ3BDLDhCQUFtQjtFQUFuQiw2QkFBbUI7VUFBbkIsbUJBQW1CLEVBQ00sYUFBYTtFQUN0QyxvQkFBYTtFQUFiLGFBQWE7RUFDYixvQkFBb0IsRUFBRSxhQUFhO0VBQ25DLG1CQUFZO1VBQVosWUFBWTtFQUNaLGdCQUFnQixFQUFFLGFBQWE7RUFDL0IsV0FBVztFQUNYLGVBQWU7QUFDakI7O0FBRUE7RUFDRSwrQ0FBK0M7QUFDakQ7O0FBRUE7RUFDRSxvQ0FBb0M7RUFDcEMsOERBQThEO0FBQ2hFOztBQUVBO0VBQ0UsaUJBQWlCO0VBQ2pCLGVBQWU7RUFDZiwyQkFBMkI7RUFDM0IsOEJBQThCO0VBQzlCLDRC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5cbi5kcmFnQ2FyZEljb24ge1xuICBvcGFjaXR5OiAwO1xuICBtYXJnaW4tYm90dG9tOiAxNXB4O1xufVxuXG4ubGFiZWxDb2x1bW4ge1xuICBwYWRkaW5nOiAzcHg7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIC1tcy1mbGV4LWRpcmVjdGlvbjogY29sdW1uOyAvKiBGb3IgSUUxMCAqL1xuICBkaXNwbGF5OiBmbGV4O1xuICBkaXNwbGF5OiAtbXMtZmxleGJveDsgLyogRm9yIElFMTAgKi9cbiAgZmxleDogMCAwIGF1dG87XG4gIC1tcy1mbGV4OiAwIDAgYXV0bzsgLyogRm9yIElFMTAgKi9cbn1cblxuLmxhYmVsIHtcbiAgd2lkdGg6IDEwMCU7XG4gIHdvcmQtd3JhcDogYnJlYWstd29yZDtcbiAgZmxleDogMSAxIGF1dG87XG4gIC1tcy1mbGV4OiAxIDEgYXV0bzsgLyogRm9yIElFMTAgKi9cbiAgZm9udC1mYW1pbHk6ICdNb250c2VycmF0Jywgc2Fucy1zZXJpZjtcbn1cblxuOjpuZy1kZWVwIC5tYXQtaW5wdXQtZWxlbWVudDpkaXNhYmxlZHtcbiAgY29sb3I6IHJnYigwLDAsMCwgLjcpICFpbXBvcnRhbnQ7XG59XG4iXX0= */\"","module.exports = \"\\n\\n
\\n clear\\n \\n \\n drag_handle\\n \\n \\n
\\n
\\n
\\n
{{label}}
\\n \\n \\n
\\n \\n \\n
\\n \\n edit\\n \\n save\\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, Inject, Input, Output} from '@angular/core';\nimport * as Color from 'color';\nimport * as Colors from 'src/app/theme/verily_colors';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\n/**\n * This is the base template for all the cards in this app. It will show a\n * colored bar on the left hand side with icons for actions, and then\n * optionally a label and legend, then the contents of the card.\n */\n@Component({\n selector: 'app-card',\n templateUrl: './card.component.html',\n styleUrls: ['./card.component.css']\n})\nexport class CardComponent {\n @Input() color: Color = Colors.BLUE_GREY_500;\n @Input() id: string;\n @Input() label: string;\n @Input() isEditable = false;\n @Input() isRemovable = true;\n\n @Output() renderEvent = new EventEmitter();\n @Output() removeEvent = new EventEmitter();\n @Output() editEvent = new EventEmitter();\n @Output() saveEvent = new EventEmitter();\n\n inEditMode = false;\n\n constructor(@Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n // The events below need to get propogated up to the card container.\n\n // Called when the user clicks the trashcan button on the card.\n remove() {\n this.removeEvent.emit(this.id);\n }\n\n // Called when the card resizes.\n resize($event) {\n this.renderEvent.emit($event);\n }\n\n // Called when the user clicks on the edit button.\n edit($event) {\n this.inEditMode = true;\n this.editEvent.emit($event);\n }\n\n // Called when the user hits the save button to exit out of edit mode.\n save($event) {\n this.inEditMode = false;\n this.saveEvent.emit($event);\n }\n}\n","module.exports = \"ngb-timepicker {\\n font-size: 1rem;\\n}\\n\\n::ng-deep fieldset {\\n min-width: 0;\\n padding: 0;\\n margin: 0;\\n border: 0;\\n}\\n\\n::ng-deep .ngb-tp {\\n display: -webkit-box;\\n display: flex;\\n -webkit-box-align: center;\\n align-items: center;\\n}\\n\\n::ng-deep .ngb-tp-hour, .ngb-tp-meridian, .ngb-tp-minute, .ngb-tp-second {\\n display: -webkit-box;\\n display: flex;\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column;\\n -webkit-box-align: center;\\n align-items: center;\\n justify-content: space-around;\\n}\\n\\n::ng-deep .ngb-tp-input-container {\\n width: 4em;\\n}\\n\\n::ng-deep .ngb-tp-spacer {\\n width: 50px !important;\\n text-align: center;\\n}\\n\\n::ng-deep .btn-link {\\n font-weight: 400;\\n color: #5E35B1;\\n background-color: transparent;\\n border-width: 1px;\\n cursor: pointer;\\n border-radius: 4px;\\n}\\n\\n::ng-deep .form-control {\\n display: block;\\n width: 100%;\\n padding: .375rem .75rem;\\n font-size: 1rem;\\n line-height: 1.5;\\n color: #495057;\\n background-color: #fff;\\n background-clip: padding-box;\\n border: 1px solid #ced4da;\\n border-radius: .25rem;\\n}\\n\\n::ng-deep .ngb-tp-input {\\n text-align: center;\\n width: inherit;\\n}\\n\\n::ng-deep .sr-only {\\n position: absolute;\\n width: 1px;\\n height: 1px;\\n padding: 0;\\n overflow: hidden;\\n clip: rect(0,0,0,0);\\n white-space: nowrap;\\n -webkit-clip-path: inset(50%);\\n clip-path: inset(50%);\\n border: none;\\n}\\n\\n::ng-deep .mat-error {\\n font-size: 12px;\\n}\\n\\n.mockPlaceholder {\\n font-size: 12px;\\n color: grey;\\n margin-top: 18px;\\n}\\n\\n::ng-deep .dateInput {\\n width: 100px !important;\\n}\\n\\n::ng-deep ngb-datepicker {\\n z-index: 4;\\n background-color:white;\\n}\\n\\n::ng-deep .date {\\n display: inline-block;\\n vertical-align: middle;\\n}\\n\\n::ng-deep .time {\\n display: inline-block;\\n margin-left:30px;\\n vertical-align: middle;\\n}\\n\\n::ng-deep .date .mockPlaceholder {\\n margin-bottom: 20px;\\n}\\n\\n::ng-deep .date .dateInput {\\n margin-bottom: 20px;\\n}\\n\\n::ng-deep .mat-dialog-container {\\n max-height: 400px !important;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZHR5cGVzL2N1c3RvbWl6YWJsZS10aW1lbGluZS9jdXN0b21pemFibGUtdGltZWxpbmUtZGlhbG9nL2N1c3RvbWl6YWJsZS10aW1lbGluZS1kaWFsb2cuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGVBQWU7QUFDakI7O0FBRUE7RUFDRSxZQUFZO0VBQ1osVUFBVTtFQUNWLFNBQVM7RUFDVCxTQUFTO0FBQ1g7O0FBRUE7RUFFRSxvQkFBYTtFQUFiLGFBQWE7RUFFYix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oNTAlKTtcbiAgYm9yZGVyOiBub25lO1xufVxuXG46Om5nLWRlZXAgLm1hdC1lcnJvciB7XG4gIGZvbnQtc2l6ZTogMTJweDtcbn1cblxuLm1vY2tQbGFjZWhvbGRlciB7XG4gIGZvbnQtc2l6ZTogMTJweDtcbiAgY29sb3I6IGdyZXk7XG4gIG1hcmdpbi10b3A6IDE4cHg7XG59XG5cbjo6bmctZGVlcCAuZGF0ZUlucHV0IHtcbiAgd2lkdGg6IDEwMHB4ICFpbXBvcnRhbnQ7XG59XG5cbjo6bmctZGVlcCBuZ2ItZGF0ZXBpY2tlciB7XG4gIHotaW5kZXg6IDQ7XG4gIGJhY2tncm91bmQtY29sb3I6d2hpdGU7XG59XG5cbjo6bmctZGVlcCAuZGF0ZSB7XG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgdmVydGljYWwtYWxpZ246IG1pZGRsZTtcbn1cblxuOjpuZy1kZWVwIC50aW1lIHtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBtYXJnaW4tbGVmdDozMHB4O1xuICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO1xufVxuXG46Om5nLWRlZXAgLmRhdGUgLm1vY2tQbGFjZWhvbGRlciB7XG4gIG1hcmdpbi1ib3R0b206IDIwcHg7XG59XG5cbjo6bmctZGVlcCAuZGF0ZSAuZGF0ZUlucHV0IHtcbiAgbWFyZ2luLWJvdHRvbTogMjBweDtcbn1cblxuOjpuZy1kZWVwIC5tYXQtZGlhbG9nLWNvbnRhaW5lciB7XG4gIG1heC1oZWlnaHQ6IDQwMHB4ICFpbXBvcnRhbnQ7XG59Il19 */\"","module.exports = \"
\\n
\\n
\\n
Date *
\\n \\n
Invalid date
\\n
\\n
\\n
Time *
\\n \\n \\n
Invalid time
\\n
\\n
\\n Caution: Date outside of current range\\n
\\n
\\n
\\n \\n \\n Please enter a title.\\n \\n \\n \\n \\n
\\n Flag color\\n \\n \\n \\n \\n \\n
\\n
\\n \\n \\n
\\n
\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, Inject} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {NgbDateAdapter, NgbDateNativeAdapter} from '@ng-bootstrap/ng-bootstrap';\nimport * as Color from 'color';\nimport {DateTime, Interval} from 'luxon';\n// tslint:disable-next-line:max-line-length\nimport {CustomizableGraphAnnotation} from 'src/app/graphtypes/customizable-graph/customizable-graph-annotation';\n// tslint:disable-next-line:max-line-length\nimport * as Colors from 'src/app/theme/verily_colors';\n\n/**\n * A Dialog with a textarea input, used to set the description of points on the\n * CustomizableTimeline.\n */\n@Component({\n selector: 'app-customizable-timeline-dialog',\n templateUrl: './customizable-timeline-dialog.component.html',\n styleUrls: ['./customizable-timeline-dialog.component.css'],\n providers: [{provide: NgbDateAdapter, useClass: NgbDateNativeAdapter}]\n})\nexport class CustomizableTimelineDialogComponent {\n // The text input for this dialog box.\n userTitle: string;\n\n // The list of suggested times to display with the autocomplete.\n listOfTimes = [];\n\n // The list of colors the user will be able to choose from.\n listOfColors = [\n Colors.DEEP_CORAL,\n Colors.DEEP_ORANGE,\n Colors.DEEP_TURQUOISE,\n Colors.DEEP_CYAN,\n Colors.DEEP_PURPLE_600,\n ];\n\n // The selected color in this dialog box.\n selectedColor: string;\n\n // The description input for this dialog box.\n userDescription: string;\n\n // The FormControl handling the time selection for this dialog box.\n timeFormControl: FormControl;\n\n // The date selected for this dialog box.\n date: Date;\n\n // The time selected for this dialog box.\n time: any;\n\n // The date range currently being viewed.\n dateRange: Interval;\n\n constructor(\n public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) public data: any) {\n this.date = new Date(data.date);\n const minutes = this.date.getMinutes();\n const hours = this.date.getHours();\n this.time = {hour: hours, minute: minutes};\n this.timeFormControl =\n new FormControl(this.time, (control: FormControl) => {\n const value = control.value;\n if (!value) {\n return null;\n }\n });\n // Set the default selected color as yellow if unset, or find the BCH Color\n // matching the selected color passed in.\n this.selectedColor = data.color ?\n this.listOfColors.find(c => c.hex() === data.color.hex()) :\n Colors.DEEP_CORAL;\n // Set the title if it is passed in.\n if (data.title) {\n this.userTitle = data.title;\n }\n // Set the description if it is passed in.\n if (data.description) {\n this.userDescription = data.description;\n }\n\n if (data.dateRange) {\n this.dateRange = Interval.fromDateTimes(\n this.data.dateRange.start.toLocal().startOf('day'),\n this.data.dateRange.end.toLocal().endOf('day'));\n }\n }\n\n // Closes the dialog popup without saving the user input.\n onCancel(): void {\n this.dialogRef.close();\n }\n\n // Closes the dialog popup and saves user input.\n onSave(): void {\n this.dialogRef.close(new CustomizableGraphAnnotation(\n DateTime.fromJSDate(this.getSelectedDate()),\n this.userTitle.trim(),\n this.userDescription,\n Color.rgb(this.selectedColor),\n ));\n }\n\n // Constructs a new Date based on user input.\n private getSelectedDate(): Date {\n const dateTime = new Date(this.date);\n if (!this.time || !this.timeFormControl.value) {\n return undefined;\n }\n // For date parsing to work in IE, we must remove all extraneous non-ASCII\n // characters added, and manually change the time.\n dateTime.setHours(this.time.hour, this.time.minute);\n return dateTime;\n }\n\n // Finds incomplete fields that are required and disables saving.\n findIncompleteFields() {\n return !this.userTitle ||\n (this.userTitle && this.userTitle.trim().length === 0) ||\n this.date === null || this.isInvalidDate() ||\n this.timeFormControl.hasError('required') ||\n this.timeFormControl.invalid;\n }\n\n // Returns whether the date input has an invalid date.\n isInvalidDate(): boolean {\n return isNaN(DateTime.fromJSDate(this.date).toMillis());\n }\n\n // Returns whether the date selected by the user falls outside the current\n // date range.\n dateNotInRange(): boolean {\n const dateTime = DateTime.fromJSDate(this.getSelectedDate());\n if (!this.dateRange) {\n return false;\n }\n return !(this.dateRange.contains(dateTime));\n }\n}\n","module.exports = \"::ng-deep [class*=\\\"timeline\\\"] .c3-xgrid-focus {\\n visibility: visible !important;\\n}\\n\\n::ng-deep .timeline .c3 {\\n cursor: default !important;\\n}\\n\\n::ng-deep .inEditMode .timeline .c3 {\\n cursor: pointer !important;\\n}\\n\\n/* Only display icons on flags in the CustomizableGraph if in edit mode. */\\n\\n::ng-deep app-customizable-graph.inEditMode .showIcon {\\n visibility: visible !important;\\n}\\n\\n::ng-deep [class*=\\\"tooltip-custom\\\"] {\\n position: absolute;\\n display: block;\\n font-size: 11px;\\n border-style: solid;\\n padding: 3px;\\n border-width: 1px;\\n border-color: grey;\\n border-radius: 3px;\\n min-height: 25px;\\n width: 200px;\\n max-height: 100px;\\n background-color: white;\\n overflow: auto;\\n color: white;\\n}\\n\\n::ng-deep [class*=\\\"tooltip-whole\\\"] {\\n position: absolute;\\n display: block;\\n min-height: 25px;\\n width: 0px;\\n max-height: 100px;\\n border-left-style: solid;\\n border-width: 1px;\\n}\\n\\n::ng-deep [class*=\\\"tooltip-title-custom\\\"] {\\n margin: 0px;\\n font-size: small;\\n text-align: center;\\n max-width: 120px;\\n display: inline-block;\\n vertical-align: bottom;\\n min-width: 120px;\\n overflow: auto;\\n margin-top: 5px;\\n overflow-wrap: break-word;\\n}\\n\\n::ng-deep [class*=\\\"tooltip-details-custom\\\"] {\\n display: none;\\n overflow: auto;\\n text-align: center;\\n overflow-wrap: break-word;\\n max-width: 120px;\\n}\\n\\n::ng-deep [id*=\\\"expand\\\"] {\\n visibility: hidden;\\n vertical-align: middle;\\n}\\n\\n::ng-deep [id*=\\\"delete\\\"] {\\n visibility: hidden;\\n vertical-align: middle;\\n}\\n\\n::ng-deep [id*=\\\"edit\\\"] {\\n visibility: hidden;\\n margin-top: 8px;\\n}\\n\\n.contents-block {\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column;\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n -webkit-box-flex: 1;\\n flex: 1 1 100%;\\n -ms-flex: 1 1 100%; /* For IE10 */\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3V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13b3JkO1xuICBtYXgtd2lkdGg6IDEyMHB4O1xufVxuXG46Om5nLWRlZXAgW2lkKj1cImV4cGFuZFwiXSB7XG4gIHZpc2liaWxpdHk6IGhpZGRlbjtcbiAgdmVydGljYWwtYWxpZ246IG1pZGRsZTtcbn1cblxuOjpuZy1kZWVwIFtpZCo9XCJkZWxldGVcIl0ge1xuICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gIHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7XG59XG46Om5nLWRlZXAgW2lkKj1cImVkaXRcIl0ge1xuICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gIG1hcmdpbi10b3A6IDhweDtcbn1cblxuLmNvbnRlbnRzLWJsb2NrIHtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgLW1zLWZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGRpc3BsYXk6IC1tcy1mbGV4Ym94O1xuICBmbGV4OiAxIDEgMTAwJTtcbiAgLW1zLWZsZXg6IDEgMSAxMDAlOyAvKiBGb3IgSUUxMCAqL1xufVxuIl19 */\"","module.exports = \"\\n \\n
\\n {{this.uiConstants.CUSTOM_TIMELINE_INSTRUCTIONS}}\\n
\\n
\\n
\\n \\n \\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// tslint:disable-next-line:max-line-length\nimport {Component, EventEmitter, Inject, Input, OnChanges, Output, SimpleChanges, ViewChild} from '@angular/core';\nimport {Interval} from 'luxon';\nimport {FhirService} from 'src/app/fhir.service';\nimport {CustomizableData} from 'src/app/graphdatatypes/customizabledata';\nimport {GraphData} from 'src/app/graphdatatypes/graphdata';\nimport {GraphComponent} from 'src/app/graphtypes/graph/graph.component';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\n/**\n * The customizable timeline lets the user plot any events they'd like to keep\n * track of as little flags along a timeline.\n */\n@Component({\n selector: 'app-customizable-timeline',\n templateUrl: './customizable-timeline.component.html',\n styleUrls: ['./customizable-timeline.component.css']\n})\nexport class CustomizableTimelineComponent implements OnChanges {\n // The GraphComponent this card holds.\n @ViewChild(GraphComponent) containedGraph!: GraphComponent;\n\n // The unique ID for this displayed card.\n @Input() id: string;\n\n /**\n * The x-axis for this card.\n */\n @Input() dateRange: Interval;\n // Data stored before deletion of the card. This is separate from this.data\n // to avoid unnecessary re-rendering of the graph.\n @Input() deletedData: any;\n\n // An event indicating that the event lines displayed on all other charts need\n // to be updated.\n @Output()\n updateEventLines =\n new EventEmitter<{[key: string]: string | CustomizableData}>();\n\n /** Propogate remove events up to the card container. */\n @Output() removeEvent = new EventEmitter();\n\n // The data for the graph contained.\n data: CustomizableData;\n\n // Whether or not this CustomizableTimeline is being edited.\n inEditMode = false;\n\n constructor(\n private fhirService: FhirService,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n this.data = CustomizableData.defaultEmptySeries();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.deletedData && changes.deletedData.currentValue) {\n this.data = this.deletedData;\n this.containedGraph.data = this.data;\n }\n }\n\n // Listens for an event indicating that the points on the CustomizableGraph\n // have been changed, and emits an event with the modified eventlines\n // displayed on all other charts.\n pointsChanged($event) {\n this.updateEventLines.emit({data: this.data, id: this.id});\n }\n\n // Called when the user clicks the trashcan button on the card.\n remove() {\n this.removeEvent.emit({id: this.id, value: this.data});\n recordGoogleAnalyticsEvent(\n 'deleteCustomTimeline', 'deleteCard', new Date().toDateString());\n }\n}\n","module.exports = \".legend {\\n cursor: pointer;\\n}\\n\\n/* This is the color swatch for the legends.*/\\n\\n.legend span {\\n border-style: solid !important;\\n height: 7px;\\n margin: 3px;\\n vertical-align: center;\\n width: 7px;\\n}\\n\\n/* This is a specific style for MultiGraphCard. */\\n\\n.contents-block {\\n -webkit-box-orient: vertical;\\n -webkit-box-direction: normal;\\n flex-direction: column; /* For IE10 */\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n}\\n\\n.axis {\\n -webkit-box-flex: 0;\\n flex: 0 0 auto;\\n -ms-flex: 0 0 auto; /* For IE10 */\\n}\\n\\n.mat-body {\\n font-family: 'Work Sans', sans-serif;\\n font-size: 14px;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZHR5cGVzL2xlZ2VuZHN0eWxlcy5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxlQUFlO0FBQ2pCOztBQUVBLDZDQUE2Qzs7QUFDN0M7RUFDRSw4QkFBOEI7RUFDOUIsV0FBVztFQUNYLFdBQVc7RUFDWCxzQkFBc0I7RUFDdEIsVUFBVTtBQUNaOztBQUVBLGlEQUFpRDs7QUFDakQ7RUFDRSw0QkFBc0I7RUFBdEIsNkJBQXNCO1VBQXRCLHNCQUFzQixFQUNNLGFBQWE7RUFDekMsb0JBQWE7RUFBYixhQUFhO0VBQ2Isb0JBQW9CLEVBQUUsYUFBYTtFQUNuQyxtQkFBWTtVQUFaLFlBQVk7RUFDWixnQkFBZ0IsRUFBRSxhQUFhO0FBQ2pDOztBQUVBO0VBQ0UsbUJBQWM7VUFBZCxjQUFjO0VBQ2Qsa0JBQWtCLEVBQUUsYUFBYTtBQUNuQzs7QUFFQTtFQUNFLG9DQUFvQztFQUNwQyxlQUFlO0FBQ2pCIiwiZmlsZSI6InNyYy9hcHAvY2FyZHR5cGVzL2xlZ2VuZHN0eWxlcy5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIubGVnZW5kIHtcbiAgY3Vyc29yOiBwb2ludGVyO1xufVxuXG4vKiBUaGlzIGlzIHRoZSBjb2xvciBzd2F0Y2ggZm9yIHRoZSBsZWdlbmRzLiovXG4ubGVnZW5kIHNwYW4ge1xuICBib3JkZXItc3R5bGU6IHNvbGlkICFpbXBvcnRhbnQ7XG4gIGhlaWdodDogN3B4O1xuICBtYXJnaW46IDNweDtcbiAgdmVydGljYWwtYWxpZ246IGNlbnRlcjtcbiAgd2lkdGg6IDdweDtcbn1cblxuLyogVGhpcyBpcyBhIHNwZWNpZmljIHN0eWxlIGZvciBNdWx0aUdyYXBoQ2FyZC4gKi9cbi5jb250ZW50cy1ibG9jayB7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIC1tcy1mbGV4LWRpcmVjdGlvbjogY29sdW1uOyAvKiBGb3IgSUUxMCAqL1xuICBkaXNwbGF5OiBmbGV4O1xuICBkaXNwbGF5OiAtbXMtZmxleGJveDsgLyogRm9yIElFMTAgKi9cbiAgZmxleDogMSAxIDAlO1xuICAtbXMtZmxleDogMSAxIDAlOyAvKiBGb3IgSUUxMCAqL1xufVxuXG4uYXhpcyB7XG4gIGZsZXg6IDAgMCBhdXRvO1xuICAtbXMtZmxleDogMCAwIGF1dG87IC8qIEZvciBJRTEwICovXG59XG5cbi5tYXQtYm9keSB7XG4gIGZvbnQtZmFtaWx5OiAnV29yayBTYW5zJywgc2Fucy1zZXJpZjtcbiAgZm9udC1zaXplOiAxNHB4O1xufSJdfQ== */\"","module.exports = \"\\n.card-error {\\n white-space: pre-wrap;\\n word-break: break-all;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY2FyZHR5cGVzL211bHRpZ3JhcGhjYXJkL211bHRpZ3JhcGhjYXJkLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBO0VBQ0UscUJBQXFCO0VBQ3JCLHFCQUFxQjtBQUN2QiIsImZpbGUiOiJzcmMvYXBwL2NhcmR0eXBlcy9tdWx0aWdyYXBoY2FyZC9tdWx0aWdyYXBoY2FyZC5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiXG4uY2FyZC1lcnJvciB7XG4gIHdoaXRlLXNwYWNlOiBwcmUtd3JhcDtcbiAgd29yZC1icmVhazogYnJlYWstYWxsO1xufVxuIl19 */\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// tslint:disable-next-line:max-line-length\nimport {Component, EventEmitter, Input, OnChanges, OnInit, Output, QueryList, SimpleChanges, ViewChildren} from '@angular/core';\nimport * as Color from 'color';\nimport {DateTime, Interval} from 'luxon';\nimport {GraphData} from 'src/app/graphdatatypes/graphdata';\nimport {LabeledSeries} from 'src/app/graphdatatypes/labeled-series';\nimport {AxisGroup} from 'src/app/graphtypes/axis-group';\nimport {LegendInfo} from 'src/app/graphtypes/legend-info';\nimport {recordGoogleAnalyticsEvent} from 'src/constants';\n\nimport {ChartType, GraphComponent} from '../../graphtypes/graph/graph.component';\nimport {LineGraphComponent} from '../../graphtypes/linegraph/linegraph.component';\nimport * as Colors from '../../theme/verily_colors';\n\n/**\n * This card holds a label, one or more graphs on one or more axes, and a\n * dragger handle.\n */\n@Component({\n selector: 'app-multigraphcard',\n styleUrls: ['../legendstyles.css', './multigraphcard.component.css'],\n templateUrl: './multigraphcard.html',\n})\nexport class MultiGraphCardComponent implements OnChanges, OnInit {\n /** The GraphComponents this card holds. */\n @ViewChildren(GraphComponent)\n containedGraphs!: QueryList>;\n\n @Input() id: string;\n\n /**\n * The date range to use for graphs in this card\n */\n @Input() dateRange: Interval;\n\n /**\n * The AxisGroup displayed on this card.\n */\n @Input() axisGroup: AxisGroup;\n\n /**\n * The format of each object in the array is an object representing a line\n * drawn on the chart, that has a value, text, and class field. The value\n * field represents the x-position of the line to be drawn, while the class\n * represents the class name, and the text represents the text displayed near\n * the line.\n */\n @Input() eventlines: Array<{[key: string]: number | string}>;\n\n /** The x-regions to draw for this graph. */\n xRegions: Array<[DateTime, DateTime]>;\n\n /** Propogate remove events up to the card container. */\n @Output() removeEvent = new EventEmitter();\n\n /**\n * The label for this graphcard.\n */\n label: string;\n\n /**\n * The units text for this card. Blank if the axes have more than one unit.\n */\n unitsLabel = '';\n\n /** Holds the color corresponding to this card. */\n color: Color = Colors.BLUE_GREY_500; // Default color for a card component.\n\n /** Hold an instance of this enum so the HTML template can reference it. */\n ChartType: typeof ChartType = ChartType;\n\n /**\n * Maps legend categories to the corresponding series so that when you hover\n * over a legend category, it can highlight all the corresponding series.\n */\n readonly legendToSeries = new Map();\n\n /**\n * Sets up the class variables that are dependent on the @Input parameter to\n * this component, resourceCodeGroups.\n * @throws An Error if ResourceCodeGroups is undefined or contains mixed\n * clinical concepts.\n */\n ngOnInit() {\n if (!this.axisGroup) {\n throw Error(\n 'All MultiGraphCardComponents are expected to have an AxisGroup ' +\n ' as the data source, but none provided for card id ' + this.id);\n }\n this.label = this.axisGroup.label;\n this.color = this.axisGroup.displayGroup.fill;\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const dateRange = changes.dateRange;\n if (dateRange && dateRange.previousValue !== dateRange.currentValue) {\n this.loadNewData();\n }\n }\n\n private addSeriesToLegendMap(series: LabeledSeries) {\n // We do not want to add the normalBound series to the legend\n if (series.legendInfo.label === LineGraphComponent.NORMAL_BOUND_SERIES_NAME) {\n return;\n }\n if (!this.legendToSeries.has(series.legendInfo)) {\n this.legendToSeries.set(series.legendInfo, []);\n }\n const added: LabeledSeries[] = this.legendToSeries.get(series.legendInfo);\n added.push(series);\n\n this.legendToSeries.set(series.legendInfo, added);\n }\n\n private loadNewData() {\n Promise\n .all(this.axisGroup.axes.map(\n axis => axis.updateDateRange(this.dateRange)))\n .then(axisData => {\n this.getLabelText().then(lblText => {\n this.unitsLabel = lblText;\n });\n\n // Gather a list of all the unique legends and series displayed.\n this.legendToSeries.clear();\n for (const data of axisData) {\n for (const series of data.series) {\n this.addSeriesToLegendMap(series);\n }\n }\n\n // Kick off the promise to get all the x-regions. It will update\n // the class variable and then everything bound to it will update,\n // too.\n this.getAllXRegions();\n });\n }\n\n /**\n * Gets the label text for this card. If the axes have all matching units,\n * it returns the units; otherwise it returns a blank string.\n */\n private getLabelText(): Promise {\n return Promise\n .all(this.axisGroup.axes.map(\n axis => axis.updateDateRange(this.dateRange)))\n .then(dataArray => dataArray.map(data => data.series))\n .then(seriesNestedArray => {\n const flattened: LabeledSeries[] = [].concat(...seriesNestedArray);\n return flattened.map(series => series.unit)\n .filter(v => v !== undefined);\n })\n .then(allUnits => {\n const units = new Set(allUnits);\n if (units.size === 1 && allUnits[0] !== undefined) {\n return ' (' + allUnits[0] + ')';\n } else {\n this.updateAxisLabels();\n return '';\n }\n });\n }\n\n /**\n * Gets all the X regions for the axes contained in this group.\n */\n private getAllXRegions() {\n return Promise.all(this.axisGroup.axes.map(axis => axis.getXRegions()))\n .then(nestedXRegions => {\n this.xRegions = [].concat(...nestedXRegions);\n });\n }\n\n /**\n * If the axes on this card have different units, make sure that each\n * axis displays its units on the y-axis, for clarity.\n */\n private updateAxisLabels() {\n for (const axis of this.axisGroup.axes) {\n axis.updateDateRange(this.dateRange).then(axisData => {\n if (axisData && axis.label && axisData.series &&\n axisData.series.length > 0 && axisData.series[0].unit) {\n const units = ' (' + axisData.series[0].unit + ')';\n // Only add units if not done so already.\n if (axis.label.indexOf(units) === -1) {\n axis.label += units;\n }\n }\n });\n }\n }\n\n /**\n * Returns true if any of the LabeledSeries passed in has a datapoint\n * in the time range.\n * This is just a convenience function because this can't be evaluated\n * directly in the Angular template.\n */\n hasData(labeledSeries: LabeledSeries[]) {\n return labeledSeries.map(s => s.hasPointInRange(this.dateRange))\n .some(s => s === true);\n }\n\n /**\n * Highlights the listed series in any graph they appear in for this card.\n */\n focusOnSeries(labeledSeries: LabeledSeries[]) {\n this.containedGraphs.forEach(graph => {\n graph.focusOnSeries(labeledSeries);\n });\n }\n\n /**\n * Removes highlight from any series on this card.\n */\n resetChart() {\n this.containedGraphs.forEach(graph => {\n graph.resetChart();\n });\n }\n\n // The events below need to get propogated up to the card container.\n\n /**\n * Called when the user clicks the trashcan button on the card.\n */\n remove() {\n // We do not add a 'value' field because there is no internal value that\n // needs to be restored when the user reverts a deletion.\n this.removeEvent.emit({id: this.id});\n recordGoogleAnalyticsEvent('deleteConcept', 'deleteCard', this.label);\n }\n}\n","module.exports = \"\\n 1\\\" class=\\\"legends-block\\\">\\n \\n
\\n \\n \\n
{{series.key.label}}
\\n
\\n
\\n
\\n
\\n
\\n \\n \\n \\n errorError loading data for: {{axis.label}}\\n Technical details:
{{axis.errorMessage}}\\n
\\n \\n 1 ? axis.label : ''\\\" [showTicks]=\\\"axis.showTicks\\\">\\n 1 ? axis.label : ''\\\" [showTicks]=\\\"axis.showTicks\\\">\\n 1 ? axis.label : ''\\\">\\n \\n 1 ? axis.label : ''\\\">\\n \\n \\n
\\n
\\n
\\n\"","module.exports = \"\\n \\n \\n \\n {{getHintText()}} \\n \\n \\n\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, ElementRef, EventEmitter, Inject, Input, Output, ViewChild} from '@angular/core';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\n/**\n * A Material Card that displays a label, a textbox, and a draggable handle\n * in a row.\n */\n@Component({\n selector: 'app-textboxcard',\n templateUrl: './textboxcard.component.html',\n})\nexport class TextboxcardComponent {\n @ViewChild('textArea') textAreaElement: ElementRef;\n @Input() id: string;\n\n /** Propogate remove events up to the card container. */\n @Output() removeEvent = new EventEmitter();\n\n // Holds the text typed in the input field of the textbox.\n @Input() noteString: string;\n\n inEditMode = false;\n\n\n constructor(@Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n updateValue() {\n this.textAreaElement.nativeElement.innerHTML = this.noteString;\n }\n\n // The events below need to get propogated up to the card container.\n\n // Called when the user clicks the trashcan button on the card.\n remove() {\n // We pass a 'value' field with the contents of the textbox so that, in case\n // of restoration of a deleted textbox, the previous value can be displayed.\n this.removeEvent.emit({id: this.id, value: this.noteString});\n\n recordGoogleAnalyticsEvent(\n 'deleteTextbox', 'deleteCard', new Date().toDateString());\n }\n\n edit() {\n this.inEditMode = true;\n }\n\n save() {\n this.inEditMode = false;\n }\n\n getHintText() {\n if (this.inEditMode) {\n return this.uiConstants.SAVE_TEXT_HINT;\n } else {\n return this.uiConstants.EDIT_TEXT_HINT;\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Interval} from 'luxon';\nimport {APP_TIMESPAN} from 'src/constants';\n\nimport {AnnotatedDiagnosticReport} from '../fhir-data-classes/annotated-diagnotic-report';\nimport {DiagnosticReport} from '../fhir-data-classes/diagnostic-report';\nimport {FhirService} from '../fhir.service';\n\nimport {CachedResourceCodeGroup, ResourceCode} from './resource-code-group';\n\n/**\n * Holds BCHMicrobioCode codes. BCH provides a custom mapping for their\n * microbiology data since retrieving it is not yet supported in the Cerner\n * FHIR API implementation.\n */\nexport class BCHMicrobioCode extends ResourceCode {\n static readonly CODING_STRING = 'http://cerner.com/bch_mapping/';\n\n dataAvailableInAppTimeScope(fhirService: FhirService): Promise {\n // This is not an elegant way of implementing this function but since it's\n // a non-standard API server we aren't going to put much effort into\n // developing it further at this point.\n return fhirService.diagnosticReportsPresentWithCodes(\n new BCHMicrobioCodeGroup(\n fhirService, this.label, [this], undefined, undefined),\n APP_TIMESPAN);\n }\n}\n\n/**\n * Represents one or more LOINC codes that should be displayed together. In the\n * case of multiple LOINC codes in a group, you should provide a label for that\n * group.\n */\nexport class BCHMicrobioCodeGroup extends\n CachedResourceCodeGroup {\n /**\n * Gets a list of DiagnosticReports corresponding to this code group. Each\n * item in the list has the same specimen type as the label of this group, and\n * each report's list of results has a code that is in this group's list of\n * codes.\n */\n getResourceFromFhir(dateRange: Interval):\n Promise {\n return this.fhirService.getDiagnosticReports(this, dateRange)\n .then(\n reports =>\n reports.map(report => new AnnotatedDiagnosticReport(report)));\n }\n\n formatRawResults(rawResults: AnnotatedDiagnosticReport[]):\n Promise {\n const diagnosticReports = rawResults.map(result => result.report);\n return Promise.resolve(diagnosticReports);\n }\n\n /**\n * Returns whether there is any data available for this ResourceCode within\n * the fixed timescope of this app.\n * @override\n */\n dataAvailableInAppTimeScope(): Promise {\n return this.fhirService.diagnosticReportsPresentWithCodes(\n this, APP_TIMESPAN);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport * as Color from 'color';\nimport * as Colors from '../theme/verily_colors';\n\nexport const ALL_DISPLAY_GROUPS_MAP = new Map();\n\n/**\n * Represents the category that a certain chart's data might fall into, for\n * example a MedicationConcept such as \"Antibiotic\" or a ClinicalConcept such as\n * \"Lab result\"\n */\nexport class DisplayGrouping {\n static colorIdx = 0;\n fill: Color;\n outline: Color;\n\n constructor(readonly label: string, color?: Color, outline?: Color) {\n let tempColor: Color = color;\n if (color === undefined) {\n tempColor = Colors.getDataColors()[DisplayGrouping.colorIdx];\n DisplayGrouping.colorIdx =\n (DisplayGrouping.colorIdx + 1) % Colors.getDataColors().length;\n }\n this.fill = tempColor;\n this.outline = outline ? outline : tempColor;\n ALL_DISPLAY_GROUPS_MAP.set(label, this);\n }\n}\n\nexport const labResult = new DisplayGrouping('Lab Results', Colors.LIME);\nexport const vitalSign = new DisplayGrouping('Vital Signs', Colors.ORANGE);\nexport const med =\n new DisplayGrouping('Vancomycin and Gentamicin', Colors.TURQUOISE);\nexport const microbio = new DisplayGrouping('Microbiology', Colors.CYAN);\n// We declare more DisplayGroupings related to Microbiology results that are\n// used to classify points on the Microbiology chart.\nexport const posPrelimMB = new DisplayGrouping(\n 'Check Result Preliminary', Color('#e4e2e2'), Colors.ABNORMAL);\nexport const negPrelimMB = new DisplayGrouping(\n 'Negative Preliminary', Color('#e4e2e2'), Colors.BLUE_A700);\nexport const posFinalMB =\n new DisplayGrouping('Check Result Final', Colors.ABNORMAL);\nexport const negFinalMB =\n new DisplayGrouping('Negative Final', Colors.BLUE_A700);\n// We declare DisplayGroupings that correspond to report statuses that we might\n// encounter rarely.\nexport const posOtherNB =\n new DisplayGrouping('Check Result, Other', Colors.DEEP_GOLD);\nexport const negOtherMB =\n new DisplayGrouping('Negative, Other', Colors.DEEP_GOLD);\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Interval} from 'luxon';\nimport {APP_TIMESPAN} from 'src/constants';\n\nimport {AnnotatedObservation} from '../fhir-data-classes/annotated-observation';\nimport {Observation} from '../fhir-data-classes/observation';\nimport {ObservationSet} from '../fhir-data-classes/observation-set';\nimport {FhirService} from '../fhir.service';\nimport {ChartType} from '../graphtypes/graph/graph.component';\n\nimport {DisplayGrouping} from './display-grouping';\nimport {ResourceCode} from './resource-code-group';\nimport {CachedResourceCodeGroup} from './resource-code-group';\n\n/**\n * Holds LOINC codes.\n */\nexport class LOINCCode extends ResourceCode {\n static readonly CODING_STRING = 'http://loinc.org';\n\n dataAvailableInAppTimeScope(fhirService: FhirService): Promise {\n return fhirService.observationsPresentWithCode(this, APP_TIMESPAN);\n }\n}\n\n/**\n * Represents one or more LOINC codes that should be displayed together. In the\n * case of multiple LOINC codes in a group, you should provide a label for that\n * group.\n */\nexport class LOINCCodeGroup extends\n CachedResourceCodeGroup {\n constructor(\n /** FHIR service for retrieving data */\n readonly fhirService: FhirService,\n /** The label for this resource code group. */\n readonly label: string,\n /** The resource codes to display on this Axis. */\n readonly resourceCodes: ResourceCode[],\n /** The display grouping for this resource code group. */\n readonly displayGrouping: DisplayGrouping,\n /** The chart type for this Axis. */\n readonly chartType: ChartType,\n /**\n * The (optional) function that will make an observation into an\n * AnnotatedObservation so that the graph can show the appropriate\n * tooltip.\n */\n readonly makeAnnotated?:\n (observation: Observation,\n dateRange: Interval) => Promise) {\n super(fhirService, label, resourceCodes, displayGrouping, chartType);\n }\n\n /**\n * Gets one ObservationSet for each LOINCCode in the rawResults, and returns\n * a list of those ObservationSets.\n * @param rawResults: List of AnnotatedObservations to group into\n * ObservationSets\n * @returns: list of ObservationSets. One ObservationSet for each LOINCCode\n * found in the rawResults.\n */\n formatRawResults(rawResults: AnnotatedObservation[]):\n Promise {\n const mapObs = new Map();\n let maxPrecision = 0;\n for (const annotatedObservation of rawResults) {\n const observation = annotatedObservation.observation;\n // From this point on, each observation should have a value,\n // result, or interpretation. All observations that just had\n // innerComponents have been flattened out.\n let obsList = mapObs.get(observation.label);\n if (!obsList) {\n obsList = new Array();\n }\n obsList.push(annotatedObservation);\n if (observation.precision > maxPrecision) {\n maxPrecision = observation.precision;\n }\n mapObs.set(observation.label, obsList);\n }\n this.precision = maxPrecision;\n const doubleAnnotationArray = Array.from(mapObs.values());\n\n return Promise.all(doubleAnnotationArray.map(\n singleAnnotationArray =>\n Promise.all(singleAnnotationArray)\n .then(\n resolvedAnnotations =>\n new ObservationSet(resolvedAnnotations))));\n }\n\n /**\n * Gets list of Observations from the FHIR server and makes them annotated\n * if makeAnnotated function is defined.\n * If an Observation contains \"inner components\", this returns separate\n * Observations for those.\n * @param dateRange: date range to get results from FHIR for\n * @returns: List of Annotated Observations\n */\n getResourceFromFhir(dateRange: Interval): Promise {\n return this.fhirService.getObservationsForCodeGroup(this, dateRange)\n .then(\n observationDoubleArray => {\n // Unnest the inner and outer observations into one flattened\n // array per concept group.\n return observationDoubleArray.map(\n obsSingleArray =>\n Array.from(obsSingleArray)\n .reduce((acc: Observation[], observation) => {\n // The outer component may not have a\n // value or result.\n if (observation.value || observation.result ||\n observation.interpretation) {\n acc.push(observation);\n }\n // Add separate ObservationLists for\n // each inner component.\n if (observation.innerComponents.length > 0) {\n for (const innerComponent of\n observation.innerComponents) {\n acc.push(innerComponent);\n }\n }\n return acc;\n }, []));\n },\n rejection => {\n // If there is any error with constructing an Observation for any\n // code in this code group, throw the error.\n throw rejection;\n })\n .then(flattened => {\n const resultList = new Array>();\n flattened.forEach(conceptList => {\n for (const observation of conceptList) {\n if (this.makeAnnotated) {\n resultList.push(this.makeAnnotated(observation, dateRange));\n } else {\n resultList.push(\n Promise.resolve(new AnnotatedObservation(observation)));\n }\n }\n });\n return Promise.all(resultList);\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\n\nimport {TimestampedObject} from '../fhir-resource-set';\nimport {FhirService} from '../fhir.service';\nimport {ChartType} from '../graphtypes/graph/graph.component';\n\nimport {DisplayGrouping} from './display-grouping';\n\n/**\n * A code specifying the medication or observation type as well as the specific\n * medication or observation.\n */\nexport abstract class ResourceCode {\n /**\n * The string that holds the FHIR address for the coding system. Every\n * extending class should override this constant, although there is no way\n * we can syntactically enforce this in Typescript.\n */\n static readonly CODING_STRING;\n\n private static readonly CODE_STRING_TO_CODE:\n {[code: string]: ResourceCode} = {};\n\n static fromCodeString(code: string): ResourceCode {\n return ResourceCode.CODE_STRING_TO_CODE[code];\n }\n\n constructor(\n readonly codeString: string, readonly displayGrouping: DisplayGrouping,\n readonly label: string, readonly showByDefault = false,\n /* Absolute axis bounds for the graph displaying this ResourceCode. */\n readonly displayBounds?: [number, number],\n /* Whether or not to force the axis bounds, even if a smaller range\n containing all the data can be calculated. */\n readonly forceDisplayBounds = false) {\n ResourceCode.CODE_STRING_TO_CODE[codeString] = this;\n }\n\n /**\n * Returns whether there is any data available for this ResourceCode within\n * the fixed timescope of this app.\n */\n abstract dataAvailableInAppTimeScope(fhirService: FhirService):\n Promise;\n}\n\n/**\n * A class that holds a group of resource codes that should be displayed on\n * the same Axis together.\n */\nexport class ResourceCodeGroup {\n /* Whether or not to show this ResourceCodeGroup by default. This is true\n * when any ResourceCode in the group should be shown as default.*/\n readonly showByDefault: boolean;\n\n // The number of decimal places to show for any value associated with this\n // resource group. The default is 0, to minimize errors caused by unnecessary\n // trailing zeros.\n precision = 0;\n\n /**\n * When we've decided whether this resource code group has data available\n * in the app, it doesn't change over the course of the app lifetime, so we\n * cache it.\n */\n resolvedDataAvailableInAppTimeScope: boolean = undefined;\n\n constructor(\n readonly fhirService: FhirService,\n /** The label for this resource code group. */\n readonly label: string,\n /** The resource codes to display on this Axis. */\n readonly resourceCodes: ResourceCode[],\n /** The display grouping for this resource code group. */\n readonly displayGrouping: DisplayGrouping,\n /** The chart type for this Axis. */\n readonly chartType: ChartType) {\n this.showByDefault = this.resourceCodes.some(code => code.showByDefault);\n }\n\n /**\n * Returns whether there is any data available for this ResourceCode within\n * the fixed timescope of this app.\n */\n dataAvailableInAppTimeScope(): Promise {\n if (this.resolvedDataAvailableInAppTimeScope !== undefined) {\n return Promise.resolve(this.resolvedDataAvailableInAppTimeScope);\n }\n return Promise\n .all(this.resourceCodes.map(\n rc => rc.dataAvailableInAppTimeScope(this.fhirService)))\n .then(bools => {\n this.resolvedDataAvailableInAppTimeScope =\n bools.reduce((result, next) => result = result || next);\n return this.resolvedDataAvailableInAppTimeScope;\n });\n }\n}\n\n/**\n * CachedResourceCodeGroups cache their retrieved data in a dictionary keyed\n * by time interval.\n * @param T The type of data to be cached.\n */\nexport abstract class CachedResourceCodeGroup<\n T, R extends TimestampedObject> extends ResourceCodeGroup {\n dataCache = new Map();\n\n /**\n * Looks in the cache to see if data for this time interval exists. If not,\n * calls the implementing class's getResourceFromFhir function and caches\n * its data, then returns the data for the given time interval.\n */\n getResourceSet(dateRange: Interval): Promise {\n const originalDataCacheCopy = new Map(this.dataCache);\n\n // today's results will never be in the cache since we always want to get\n // updated results for today.\n const today = DateTime.utc().toISODate();\n const todaysResults = new Array();\n\n // get the days during the dateRange Inteval that we do not have in the\n // cache already.\n const daysToFetchFromFhir = new Array();\n\n // splits dateRange into an array of intervals - each 1 day long.\n const daysInRange =\n Interval\n .fromDateTimes(\n dateRange.start.startOf('day'), dateRange.end.endOf('day'))\n .splitBy({days: 1});\n\n // for each day in the range, check if it is in the cache already.\n // If not, add the day to the daysToFetchFromFhir and add an empty array\n // to the cache. We add an empty array so that if we don't get any results\n // back for a particular day, we know there is no data and we don't need to\n // request that day again.\n for (const dayRange of daysInRange) {\n const cacheKey = dayRange.start.toISODate();\n if (!this.dataCache.has(cacheKey)) {\n daysToFetchFromFhir.push(dayRange);\n // We do not want to cache today's results since their may be\n // additional results next time this data is fetched\n // from FHIR\n if (cacheKey !== today) {\n this.dataCache.set(cacheKey, new Array());\n }\n }\n }\n\n // This will give a list of the minimal covering set of intervals that\n // are not cached.\n const dateRangesToFetchFromFhir = Interval.merge(daysToFetchFromFhir);\n let fetchPromises = [];\n\n try {\n fetchPromises = dateRangesToFetchFromFhir.map(\n dateRangeToFetch =>\n this.getResourceFromFhir(dateRangeToFetch)\n .then(\n response => {\n for (const result of response) {\n const resultDate = result.timestamp.toISODate();\n // we keep today's results separate so that we\n // don't cache them.\n if (resultDate === today) {\n todaysResults.push(result);\n } else {\n this.dataCache.get(resultDate).push(result);\n }\n }\n },\n rejection => {\n // reset back to cache if any call to FHIR results in\n // an error.\n this.dataCache = originalDataCacheCopy;\n throw rejection;\n }));\n } catch (err) {\n // reset back to original cache if there were any issues adding to the\n // cache (such as a result not having a timestamp) - we do not want to\n // cache partial data.\n this.dataCache = originalDataCacheCopy;\n throw err;\n }\n\n return Promise.all(fetchPromises)\n .then(\n responseList => {\n return this.getResourceFromCache(dateRange).then(\n rawResults => this.formatRawResults(\n [].concat(rawResults, todaysResults)));\n },\n rejection => {\n this.dataCache = originalDataCacheCopy;\n throw rejection;\n });\n }\n\n /**\n * Gets data from the cache for the given date range.\n * @param dateRange date range to get data for\n */\n private getResourceFromCache(dateRange: Interval): Promise {\n // split the dateRange by day intervals and get data from the Cache.\n const allRawResults = new Array();\n dateRange.splitBy({days: 1}).forEach(dayRange => {\n allRawResults.push(...this.dataCache.get(dayRange.start.toISODate()));\n });\n return Promise.resolve(allRawResults);\n }\n\n /**\n * Formats raw results from the cache to results expected by the rendering\n * code.\n *\n * Note: This should really be a private method and never called by anything\n * except for getResourceSet. Since it is abstract though, we cannot make it\n * private.\n *\n * @param rawResults raw results from the cache that should be formatted.\n */\n abstract formatRawResults(rawResults: R[]): Promise;\n\n /**\n * This function should make the FHIR calls to get promises for the\n * resources corresponding to this resource code group.\n */\n abstract getResourceFromFhir(dateRange: Interval): Promise;\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {vitalSign} from './display-grouping';\nimport {LOINCCode} from './loinc-code';\n\nexport const bloodPressureLoincs = [\n new LOINCCode('55284-4', vitalSign, 'Blood Pressure', true),\n new LOINCCode(\n '8478-0', vitalSign, 'Mean Arterial Pressure (Device)', true, [25, 200])\n ];\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Injectable} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {Interval} from 'luxon';\n\nimport {LOINCCodeGroup} from '../clinicalconcepts/loinc-code';\nimport {AnnotatedObservation} from '../fhir-data-classes/annotated-observation';\nimport {Observation} from '../fhir-data-classes/observation';\nimport {FhirService} from '../fhir.service';\nimport {Axis} from '../graphtypes/axis';\nimport {AxisGroup} from '../graphtypes/axis-group';\nimport {ChartType} from '../graphtypes/graph/graph.component';\n\nimport {BCHMicrobioCode, BCHMicrobioCodeGroup} from './bch-microbio-code';\nimport {DisplayGrouping, labResult, med, microbio, vitalSign} from './display-grouping';\nimport {bloodPressureLoincs} from './resource-code-manager-exports';\n\nimport {LOINCCode} from './loinc-code';\nimport {RXNORM_CODES, RxNormCode} from './rx-norm';\nimport {RxNormCodeGroup} from './rx-norm-group';\n\n// We declare a new LOINCCode referencing a DocumentReference, but do not\n// include it in the groupings below because it is not graphed/displayed in the\n// configuration sidebar.\nexport const documentReferenceLoinc =\n new LOINCCode('68608-9', undefined, 'Summary', true);\n\nconst ovaAndParasiteExam = new BCHMicrobioCode(\n 'OVAANDPARASITEEXAM', microbio, 'Ova and Parasite Exam', false);\n\nconst salmonella = new BCHMicrobioCode(\n 'SALMONELLAANDSHIGELLACULTURE', microbio, 'Salmonella and Shigella Culture',\n false);\n\n/**\n * ResourceCodeManager is the centralized class where other components can\n * look to find an exhaustive listing of all the resource code groups that the\n * application may display.\n */\n@Injectable()\nexport class ResourceCodeManager {\n private static axisGroups: AxisGroup[];\n private static displayGroupMapping: Map;\n\n\n static readonly labLoincs = [\n // Pull all the defaults to the top.\n new LOINCCode(\n '1988-5', labResult, 'C-Reactive Protein', true, [0, 100], true),\n new LOINCCode(\n '4537-7', labResult, 'ESR (Erythrocyte Sedimentation Rate)', true,\n [0, 200]),\n new LOINCCode('3094-0', labResult, 'BUN', true),\n new LOINCCode('2160-0', labResult, 'Creatinine', true),\n new LOINCCode('1742-6', labResult, 'ALT', true),\n new LOINCCode(\n '1920-8', labResult, 'AST (Aspartate Aminotransferase)', true),\n new LOINCCode('6768-6', labResult, 'Alkaline Phosphatase', true),\n new LOINCCode('1968-7', labResult, 'Bilirubin, Direct', true),\n new LOINCCode('1975-2', labResult, 'Bilirubin, Total', true),\n new LOINCCode('3084-1', labResult, 'Uric acid', false)\n ];\n\n private static readonly vitalLoincs = [\n new LOINCCode('8310-5', vitalSign, 'Temperature', true, [35, 41]),\n new LOINCCode('8867-4', vitalSign, 'Heart Rate', true, [20, 300]),\n new LOINCCode('9279-1', vitalSign, 'Respiratory Rate', true, [6, 100]),\n new LOINCCode(\n '59408-5', vitalSign, 'Oxygen Saturation (SpO2)', true, [5, 100], true)\n ];\n\n /**\n * Although these two measurements have independent LOINC codes they only ever\n * appear as sub-measurements of the larger entity for \"blood pressure\" in the\n * way that BCH data shows up.\n */\n private static readonly diastolicBP = new LOINCCode(\n '8462-4', vitalSign, 'Diastolic Blood Pressure', true, [25, 150]);\n private static readonly systolicBP = new LOINCCode(\n '8480-6', vitalSign, 'Systolic Blood Pressure', true, [30, 250]);\n\n // \"bloodPressureLoincs\" is in file resource-code-manager-exports.ts because\n // of circular dependency issues.\n\n private static readonly gentMonitoring = [\n new LOINCCode('31091-2', labResult, 'Gentamicin, Peak/Post Q24H'),\n new LOINCCode('3663-2', labResult, 'Gentamicin, Peak/Post Q8H'),\n new LOINCCode('31092-0', labResult, 'Gentamicin, Trough/Pre Q24H'),\n new LOINCCode('3665-7', labResult, 'Gentamicin, Trough/Pre Q8H')\n ];\n\n private static readonly vancMonitoring = [\n new LOINCCode('20578-1', labResult, 'Vancomycin Level, Random', true),\n new LOINCCode('4092-3', labResult, 'Vancomycin Level, Trough/Pre', true),\n ];\n\n private static readonly urineGroup = [\n new LOINCCode('5769-5', labResult, 'Bacteria, Urinalysis'),\n new LOINCCode('50551-1', labResult, 'Bilirubin, Urinalysis'),\n new LOINCCode('5794-3', labResult, 'Blood, Urinalysis'),\n new LOINCCode('21033-6', labResult, 'Budding Yeast, Urinalysis'),\n new LOINCCode('41865-7', labResult, 'Hyphal Yeast, Urinalysis'),\n new LOINCCode('25157-9', labResult, 'Epithelial Cast, Urinalysis'),\n new LOINCCode('50558-6', labResult, 'Nitrite, Urinalysis'),\n new LOINCCode('57735-3', labResult, 'Protein, Urinalysis'),\n new LOINCCode('58449-0', labResult, 'Red Blood Cell Clump, Urinalysis'),\n new LOINCCode('13945-1', labResult, 'Red Cells, Urinalysis'),\n new LOINCCode('11277-1', labResult, 'Squamous Epithelial, Urinalysis'),\n new LOINCCode('50563-6', labResult, 'Urobilinogen, Urinalysis'),\n new LOINCCode('5799-2', labResult, 'WBC Enzyme, Urinalysis'),\n new LOINCCode('33825-1', labResult, 'White Blood Cell Clump, Urinalysis'),\n new LOINCCode('20408-1', labResult, 'White Cells, Urinalysis'),\n ];\n\n private static readonly csfGroup = [\n new LOINCCode('10333-3', labResult, 'Appearance, CSF', false, [0, 100]),\n new LOINCCode('13517-8', labResult, 'Atypical Lymph, CSF', false, [0, 100]),\n new LOINCCode('12278-8', labResult, 'Band, CSF', false, [0, 100]),\n new LOINCCode('30374-3', labResult, 'Basophil, CSF', false, [0, 100]),\n new LOINCCode('12208-5', labResult, 'Eosinophil, CSF', false, [0, 100]),\n new LOINCCode('2342-4', labResult, 'Glucose, CSF', false, [0, 100]),\n new LOINCCode('10328-3', labResult, 'Lymphocyte, CSF', false, [0, 100]),\n new LOINCCode('10329-1', labResult, 'Monocyte, CSF', false, [0, 100]),\n new LOINCCode('12278-8', labResult, 'Neutrophil/Band, CSF', false, [0, 100])\n ];\n\n private static readonly otherFluidGroup = [\n new LOINCCode('9335-1', labResult, 'Appearance, Other Fluid'),\n new LOINCCode(\n '31208-2', labResult, 'Cell Count Source, Other Fluid', false,\n [0, 100000]),\n new LOINCCode(\n '47938-6', labResult, 'Cell Count, Other Source', false, [0, 100000]),\n new LOINCCode('38256-4', labResult, 'Cells Counted, Other Fluid'),\n new LOINCCode('6824-7', labResult, 'Color, Other Fluid'),\n new LOINCCode('12209-3', labResult, 'Eosinophil, Other Fluid')\n ];\n\n private static stoolGroupMB = [\n new BCHMicrobioCode(\n 'CDIFFICILEEIAWRFLXTOAMPLIFIEDDNA', microbio,\n 'C difficile EIA w/rflx to amplified DNA', true),\n new BCHMicrobioCode(\n 'CAMPYLOBACTERCULTURE', microbio, 'Campylobacter Culture', true),\n new BCHMicrobioCode(\n 'ENTEROHEMORRHAGICECOLITEST', microbio, 'Enterohemorrhagic E coli Test',\n true),\n new BCHMicrobioCode(\n 'SALMONELLAANDSHIGELLACULTURE', microbio,\n 'Salmonella and Shigella Culture', true),\n new BCHMicrobioCode('YERSINIACULTURE', microbio, 'Yersinia Culture', true),\n ];\n\n // Visible for testing.\n static respiratoryGroupMB = [\n new BCHMicrobioCode(\n 'ADENOVIRUSPCRRESPQUAL', microbio, 'Adenovirus PCR, Resp, QuaL', true),\n new BCHMicrobioCode(\n 'INFLUENZAABRSVPCRWASUBTYPEQUAL', microbio,\n 'Influenza A/B, RSV PCR w/A Subtype, QuaL', true),\n new BCHMicrobioCode(\n 'RESPIRATORYCULTUREANDGRAMSTAIN', microbio,\n 'Respiratory Culture and Gram Stain', true),\n new BCHMicrobioCode(\n 'VIRALDFARESPIRATORY', microbio, 'Viral DFA Respiratory', true),\n new BCHMicrobioCode(\n 'PARAINFLUENZA1DFA', microbio, 'Parainfluenza 1 DFA', true),\n new BCHMicrobioCode(\n 'PARAINFLUENZA123DFA', microbio, 'Parainfluenza 1, 2, 3 DFA', true),\n new BCHMicrobioCode(\n 'PARAINFLUENZA2DFA', microbio, 'Parainfluenza 2 DFA', true),\n new BCHMicrobioCode(\n 'PARAINFLUENZA3DFA', microbio, 'Parainfluenza 3 DFA', true),\n ];\n\n // Visible for testing.\n static otherGroupMB = [\n new BCHMicrobioCode(\n 'AFBCULTUREANDSTAIN', microbio, 'AFB Culture and Stain', true),\n new BCHMicrobioCode(\n 'ANAEROBICCULTURE', microbio, 'Anaerobic Culture', true),\n new BCHMicrobioCode(\n 'ASPERGILLUSGALACTOMANNANEIA', microbio,\n 'Aspergillus galactomannan EIA', true),\n new BCHMicrobioCode(\n 'CMVSHELLVIALCULTURE', microbio, 'CMV Shell Vial Culture', true),\n new BCHMicrobioCode(\n 'CATHETERTIPTUBINGFOREIGNBODYCULTURE', microbio,\n 'Catheter Tip/Tubing/Foreign Body Culture', true),\n new BCHMicrobioCode(\n 'FLUIDCULTUREANDGRAMSTAIN', microbio, 'Fluid Culture and Gram Stain',\n true),\n new BCHMicrobioCode('FUNGUSCULTURE', microbio, 'Fungus Culture', true),\n new BCHMicrobioCode('KOHFUNGALSTAIN', microbio, 'KOH Fungal Stain', true),\n new BCHMicrobioCode(\n 'TISSUECULTUREANDGRAMSTAIN', microbio, 'Tissue Culture and Gram Stain',\n true),\n new BCHMicrobioCode('VZVDFA', microbio, 'VZV DFA', true),\n new BCHMicrobioCode(\n 'VIRALCULTURENONRESPIRATORY', microbio,\n 'Viral Culture, Non Respiratory', true),\n new BCHMicrobioCode(\n 'WOUNDCULTUREANDGRAMSTAIN', microbio, 'Wound Culture and Gram Stain',\n true),\n new BCHMicrobioCode('HSVDFA', microbio, 'HSV DFA', true),\n new BCHMicrobioCode(\n 'HERPESSIMPLEXVIRUS12PCRQUAL', microbio,\n 'Herpes Simplex Virus 1/2 PCR, QuaL', true),\n ];\n\n private static bloodGroupMB = [\n new BCHMicrobioCode(\n 'ADENOVIRUSPCRQUANT', microbio, 'Adenovirus PCR, QuaNT', true),\n new BCHMicrobioCode(\n 'BLOODCULTUREROUTINEAEROBIC', microbio,\n 'Blood Culture Routine, Aerobic', true),\n new BCHMicrobioCode(\n 'BLOODCULTUREAEROBICANDANAEROBIC', microbio,\n 'Blood Culture, Aerobic and Anaerobic', true),\n new BCHMicrobioCode(\n 'BLOODCULTUREFUNGUS', microbio, 'Blood Culture, Fungus', true),\n new BCHMicrobioCode(\n 'CYTOMEGALOVIRUSPCRQUANT', microbio, 'Cytomegalovirus PCR, QuaNT',\n true),\n new BCHMicrobioCode(\n 'EPSTEINBARRVIRUSPCRQUANT', microbio, 'Epstein-Barr Virus PCR, QuaNT',\n true),\n ];\n\n private static csfGroupMB = [\n new BCHMicrobioCode(\n 'CSFCULTUREANDGRAMSTAIN', microbio, 'CSF Culture and Gram Stain', true),\n new BCHMicrobioCode(\n 'ENTEROVIRUSPCRCSFQUAL', microbio, 'Enterovirus PCR, CSF, QuaL', true)\n ];\n\n private static typeToPairs: Array<[DisplayGrouping, LOINCCode[]]> = [\n [vitalSign, ResourceCodeManager.vitalLoincs],\n [labResult, ResourceCodeManager.labLoincs],\n ];\n\n constructor(\n private fhirService: FhirService, private sanitizer: DomSanitizer) {\n if (ResourceCodeManager.axisGroups) {\n return;\n }\n\n\n const codeGroups = new Array();\n // All the labs and vitals are linecharts and displayed on\n // independent axes.\n for (const [conceptGroup, codePairs] of ResourceCodeManager.typeToPairs) {\n for (const loinc of codePairs) {\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, loinc.label, new Array(loinc), conceptGroup,\n ChartType.LINE),\n loinc.label)]));\n }\n }\n\n const bpLocation = new LOINCCodeGroup(\n this.fhirService, 'Blood Pressure Details',\n [new LOINCCode('41904-4', vitalSign, 'Blood Pressure Location', true)],\n vitalSign, ChartType.SCATTER);\n // Add the blood pressure LOINCs.\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, 'Blood Pressure',\n bloodPressureLoincs, vitalSign, ChartType.LINE,\n (observation: Observation, dateRange: Interval):\n Promise => {\n return bpLocation.getResourceSet(dateRange).then(obsSet => {\n return AnnotatedObservation.forBloodPressure(\n observation,\n // We only pass in the first ObservationSet, since we\n // know there is only one code whose observations we\n // care about.\n obsSet[0]);\n });\n }),\n 'Blood Pressure')]));\n\n const cbc = [\n new LOINCCodeGroup(\n this.fhirService, 'WBC',\n [new LOINCCode('26464-8', labResult, 'WBC', false, [0, 150])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Hemoglobin',\n [new LOINCCode('718-7', labResult, 'Hemoglobin', false, [0.5, 30])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Hematocrit',\n [new LOINCCode('4544-3', labResult, 'Hematocrit', false, [10, 70])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Platelet',\n [new LOINCCode('777-3', labResult, 'Platelet', false, [2, 900])],\n labResult, ChartType.LINE),\n ];\n\n codeGroups.push(new AxisGroup(\n cbc.map(\n codeGroup => new Axis(\n this.fhirService, this.sanitizer, codeGroup, codeGroup.label)),\n 'Complete Blood Count'));\n\n const cbcWBC = [\n new LOINCCodeGroup(\n this.fhirService, 'Neutrophil/Band',\n [new LOINCCode(\n '35332-6', labResult, 'Neutrophil/Band', true, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Immature Granulocytes',\n [new LOINCCode(\n '38518-7', labResult, 'Immature Granulocytes', false, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Lymphocyte',\n [new LOINCCode('736-9', labResult, 'Lymphocyte', false, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Monocyte',\n [new LOINCCode('5905-5', labResult, 'Monocyte', false, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Eosinophil',\n [new LOINCCode('713-8', labResult, 'Eosinophil', false, [0, 100])],\n labResult, ChartType.LINE),\n new LOINCCodeGroup(\n this.fhirService, 'Basophil',\n [new LOINCCode('706-2', labResult, 'Basophil', false, [0, 100])],\n labResult, ChartType.LINE),\n\n ];\n codeGroups.push(new AxisGroup(\n cbcWBC.map(\n codeGroup => new Axis(\n this.fhirService, this.sanitizer, codeGroup, codeGroup.label)),\n 'Complete Blood Count White Blood Cell'));\n\n const medsSummaryGroup = RXNORM_CODES;\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new RxNormCodeGroup(\n this.fhirService, 'Vancomycin & Gentamicin Summary',\n medsSummaryGroup, med, ChartType.STEP),\n 'Vancomycin & Gentamicin Summary')]));\n\n // Drug monitoring should be a scatterplot, and the related concepts\n // should be displayed on the same axes.\n const vancRxNorm = new RxNormCodeGroup(\n this.fhirService, 'Administrations',\n [RxNormCode.fromCodeString('11124')], med, ChartType.SCATTER);\n\n // Drug monitoring should be a scatterplot, and the related concepts\n // should be displayed on the same axes.\n const vancMonitoring = [\n vancRxNorm,\n new LOINCCodeGroup(\n this.fhirService, 'Monitoring', ResourceCodeManager.vancMonitoring,\n med, ChartType.SCATTER,\n (observation: Observation, dateRange: Interval):\n Promise => {\n return vancRxNorm.getResourceSet(dateRange).then(rxNorms => {\n // We know that we're only pushing in one RxNorm\n // so it's safe to grab the first (and only) one in\n // the list.\n return AnnotatedObservation.forMedicationMonitoring(\n observation, rxNorms[0].orders);\n });\n })\n ];\n\n codeGroups.push(new AxisGroup(\n vancMonitoring.map(\n codeGroup => new Axis(\n this.fhirService, this.sanitizer, codeGroup, codeGroup.label)),\n 'Vancomycin'));\n\n const gentMonitoring = [\n new RxNormCodeGroup(\n this.fhirService, 'Administrations',\n [RxNormCode.fromCodeString('1596450')], med, ChartType.SCATTER),\n new LOINCCodeGroup(\n this.fhirService, 'Monitoring', ResourceCodeManager.gentMonitoring,\n med, ChartType.SCATTER)\n ];\n\n codeGroups.push(new AxisGroup(\n gentMonitoring.map(\n codeGroup => new Axis(\n this.fhirService, this.sanitizer, codeGroup, codeGroup.label)),\n 'Gentamicin'));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, 'Urinalysis', ResourceCodeManager.urineGroup,\n labResult, ChartType.SCATTER),\n 'Urinalysis')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, 'CSF', ResourceCodeManager.csfGroup, labResult,\n ChartType.SCATTER),\n 'CSF')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new LOINCCodeGroup(\n this.fhirService, 'Other Fluid',\n ResourceCodeManager.otherFluidGroup, labResult, ChartType.SCATTER),\n 'Other Fluid')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'Stool', ResourceCodeManager.stoolGroupMB,\n microbio, ChartType.MICROBIO),\n 'Stool')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'Respiratory',\n ResourceCodeManager.respiratoryGroupMB, microbio,\n ChartType.MICROBIO),\n 'Respiratory')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'Other', ResourceCodeManager.otherGroupMB,\n microbio, ChartType.MICROBIO),\n 'Other')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'Blood', ResourceCodeManager.bloodGroupMB,\n microbio, ChartType.MICROBIO),\n 'Blood')]));\n\n codeGroups.push(new AxisGroup([new Axis(\n this.fhirService, this.sanitizer,\n new BCHMicrobioCodeGroup(\n this.fhirService, 'CSF Microbiology',\n ResourceCodeManager.csfGroupMB, microbio, ChartType.MICROBIO),\n 'CSF Microbiology')]));\n\n ResourceCodeManager.axisGroups = codeGroups;\n\n const mapping = new Map();\n for (const group of this.getResourceCodeGroups()) {\n if (mapping.has(group.displayGroup)) {\n mapping.get(group.displayGroup).push(group);\n } else {\n mapping.set(group.displayGroup, [group]);\n }\n }\n ResourceCodeManager.displayGroupMapping = mapping;\n }\n\n /**\n * Returns the ResourceCodeGroups to be displayed. If the maps have already\n * been constructed, returns the static variable holding the information.\n * If not, constructs the maps and saves them into the static class variable,\n * then returns.\n */\n getResourceCodeGroups(): AxisGroup[] {\n return ResourceCodeManager.axisGroups;\n }\n\n /**\n * Returns a map where the key is a clinical concept group and the value is\n * a list of LOINC code groups belonging to the clinical concept group.\n */\n getDisplayGroupMapping(): Map {\n return ResourceCodeManager.displayGroupMapping;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Interval} from 'luxon';\nimport {CachedResourceCodeGroup} from '../clinicalconcepts/resource-code-group';\nimport {MedicationAdministration} from '../fhir-data-classes/medication-administration';\nimport {MedicationOrder, MedicationOrderSet, MedicationOrderStatus} from '../fhir-data-classes/medication-order';\n\nimport {RxNormCode} from './rx-norm';\n\n/**\n * Represents one or more RxNorm codes that should be displayed together. In the\n * case of multiple RxNorm codes in a group, you should provide a label for that\n * group.\n */\nexport class RxNormCodeGroup extends\n CachedResourceCodeGroup {\n medicationOrderCache = new Map();\n\n /**\n * Gets all Medication Administrations in this group from FHIR for the given\n * date range.\n * @param dateRange date range to get medication administrations for\n */\n getResourceFromFhir(dateRange: Interval):\n Promise {\n return this.fhirService.getMedicationAdministrationsWithCodes(\n this, dateRange);\n }\n\n /**\n * Fills out the order and administration information for each\n * RxNormCode in this group, and returns a list of the populated RxNormCodes.\n * This is a roundabout process because the Cerner implementation of the\n * FHIR standard doesn't allow for searching MedicationOrders by RxNorm code,\n * so we have to search for MedicationAdministrations by RxNorm code and work\n * up from there.\n */\n formatRawResults(rawResults: MedicationAdministration[]):\n Promise {\n const groupedByOrder = this.groupAdministrationsByOrderId(rawResults);\n return this.getMedicationOrdersAndMapToMed(groupedByOrder);\n }\n\n /**\n * Takes a list of lists of MedicationAdministrations and groups them by their\n * order IDs. Each list represents a set of MedicationAdministrations for a\n * specific RxNorm, but they're not arranged by order. For example:\n *\n * [[admin1_rxnorm1_orderA, admin2_rxnorm1_orderB, admin3_rxnorm1_orderB],\n * [admin1_rxnorm2_orderC, admin2_rxnorm2_orderC],\n * [admin1_rxnorm3_orderD]]\n *\n * would yield:\n *\n * {orderA: [admin1_rxnorm1_orderA],\n * orderB: [admin2_rxnorm1_orderB, admin3_rxnorm1_orderB],\n * orderC: [admin1_rxnorm2_orderC, admin2_rxnorm2_orderC],\n * orderD: [admin1_rxnorm3_orderD]\n * }\n * @param medAdmins A list of lists of MedicationAdministrations. See above.\n * @returns A map of order IDs to a list of corresponding\n * MedicationAdministrations.\n */\n private groupAdministrationsByOrderId(medAdmins: MedicationAdministration[]):\n Map {\n let groupedByOrder = new Map();\n // Group medication administrations by medication order.\n groupedByOrder = medAdmins.reduce(\n (groups: Map,\n medAdmin: MedicationAdministration) => {\n // Append this administration to whatever order list it belongs to.\n const orderId: string = medAdmin.medicationOrderId;\n if (!groups.has(orderId)) {\n groups.set(orderId, new Array());\n }\n groups.set(orderId, groups.get(orderId).concat(medAdmin));\n return groups;\n },\n // Use whatever existed in groupedByOrder prior to this iteration as\n // the basis for the reducer to add to.\n groupedByOrder);\n\n return groupedByOrder;\n }\n\n /**\n * Transforms a map with keys of MedicationOrder IDs and values of\n * MedicationAdministrations to a list of RxNormCodes, with the RxNormCodes\n * containing their corresponding MedicationOrders, and the medicationOrders\n * containing their corresponding MedicationAdministrations. For example:\n *\n * {orderA: [admin1_rxnorm1_orderA],\n * orderB: [admin2_rxnorm1_orderB, admin3_rxnorm1_orderB],\n * orderC: [admin1_rxnorm2_orderC, admin2_rxnorm2_orderC],\n * orderD: [admin1_rxnorm3_orderD]\n * }\n *\n * would yield:\n *\n * [RxNorm1 = {orders:\n * [OrderA {administrationsForOrder: [admin1_rxnorm1_orderA]},\n * OrderB {administrationsForOrder: [admin2_rxnorm1_orderB,\n * admin3_rxnorm1_orderB]}]}\n * RxNorm2 = {orders:\n * [OrderC {administrationsForOrder: [admin1_rxnorm2_orderC,\n * admin2_rxnorm2_orderC]}]}\n * RxNorm3 = {orders:\n * [OrderD {administrationsForOrder: [admin1_rxnorm3_orderD]}]}\n *\n * @param groupedByOrder A map with keys of MedicationOrder IDs and values of\n * MedicationAdministrations for those MedicationOrders.\n * @returns A list of RxNormCodes with orders populated\n * @throws Error if the incoming parameter has medication administrations that\n * did not come from the same order for the same med\n */\n private getMedicationOrdersAndMapToMed(\n groupedByOrder: Map):\n Promise {\n const groupedByMed = new Map();\n const allPromises = Array.from(groupedByOrder.keys()).map(orderId => {\n if (this.medicationOrderCache.has(orderId)) {\n return Promise.resolve(this.medicationOrderCache.get(orderId));\n } else {\n return this.fhirService.getMedicationOrderWithId(orderId).then(\n order => {\n // We only have the MedicationAdministrations from within the\n // specified time window, so we have to search again for all the\n // MedicationAdministrations present for this order and assign\n // them to the order.\n // We assume that an administration will always have a\n // corresponding order.\n return order.setMedicationAdministrations(this.fhirService)\n .then(order => {\n // if this order will not have any additional data added,\n // we add it to the medication order cache.\n if (order.status === MedicationOrderStatus.COMPLETED ||\n order.status === MedicationOrderStatus.STOPPED) {\n this.medicationOrderCache.set(orderId, order);\n }\n return order;\n });\n },\n rejection => {\n // If there are any errors constructing MedicationOrders for\n // this RxNormCode[], throw the error.\n throw rejection;\n });\n }\n });\n\n // Resolve all the promises and set the corresponding orders for each\n // RxNorm.\n return Promise.all(allPromises)\n .then(orders => {\n orders.map(\n (order: MedicationOrder) => {\n // Verify all the administrations have the same RxNormCode and\n // same Order ID.\n const rxNormCodeSet = new Set(\n Array.from(groupedByOrder.get(order.orderId).values())\n .map(admin => admin.rxNormCode));\n if (rxNormCodeSet.size !== 1) {\n throw Error(\n 'Administrations for order ' + order.orderId +\n ' are for multiple RxNorms: ' +\n Array.from(rxNormCodeSet.values()));\n }\n\n const orderSet = new Set(\n Array.from(groupedByOrder.get(order.orderId).values())\n .map(admin => admin.medicationOrderId));\n if (rxNormCodeSet.size !== 1) {\n throw Error(\n 'Administrations for order ' + order.orderId +\n ' report multiple order IDs: ' + Array.from(orderSet));\n }\n\n // Add the order to the map for the RxNorm code.\n const rxCode = rxNormCodeSet.values().next().value;\n if (groupedByMed.has(rxCode)) {\n groupedByMed.set(\n rxCode, groupedByMed.get(rxCode).concat(order));\n } else {\n groupedByMed.set(rxCode, new Array(order));\n }\n },\n rejection => {\n // If there are any errors constructing MedicationOrders for\n // this RxNormCode[], throw the error.\n throw rejection;\n });\n })\n .then(\n _ => {\n Array.from(groupedByMed.entries()).forEach(medEntry => {\n const rxNorm = medEntry[0];\n const medOrders = medEntry[1];\n rxNorm.orders = new MedicationOrderSet(medOrders);\n });\n // Return all the populated RxNorms.\n return Array.from(groupedByMed.keys());\n },\n rejection => {\n // If any promise is rejected, throw the same rejection.\n throw rejection;\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {APP_TIMESPAN} from 'src/constants';\n\nimport {ResourceCode} from '../clinicalconcepts/resource-code-group';\nimport {MedicationOrderSet} from '../fhir-data-classes/medication-order';\nimport {FhirService} from '../fhir.service';\nimport * as Colors from '../theme/verily_colors';\n\nimport {DisplayGrouping} from './display-grouping';\n\nexport class MedicationConceptGroup extends DisplayGrouping {}\n\nexport const ANTIBIOTIC =\n new MedicationConceptGroup('Antibiotic', Colors.DEEP_TURQUOISE);\n\nexport const MEDICATION_GROUPS = [ANTIBIOTIC];\n\n/**\n * Holds RXNorm codes and orders corresponding to them.\n */\nexport class RxNormCode extends ResourceCode {\n static readonly CODING_STRING = 'http://www.nlm.nih.gov/research/umls/rxnorm';\n\n /* Contains a set of medication orders for this RxNorm code. */\n orders: MedicationOrderSet;\n\n dataAvailableInAppTimeScope(fhirService: FhirService): Promise {\n return fhirService.medicationsPresentWithCode(this, APP_TIMESPAN);\n }\n}\n\nexport const RXNORM_CODES = [\n // Parenteral antibiotics\n new RxNormCode('11124', ANTIBIOTIC, 'Vancomycin', true),\n new RxNormCode('1596450', ANTIBIOTIC, 'Gentamicin')\n];\n","module.exports = \".previewSave {\\n background-color:#202020; /* GREY_900 */\\n display: -webkit-box;\\n display: flex;\\n padding: 15px;\\n width: 90%;\\n overflow: auto;\\n max-height: 80%;\\n /* Disable selecting/highlighting on the page. */\\n -webkit-touch-callout: none; /* iOS Safari */\\n -webkit-user-select: none; /* Safari */\\n -moz-user-select: none; /* Firefox */\\n -ms-user-select: none; /* Internet Explorer/Edge */\\n user-select: none; /* Chrome and Opera */\\n}\\n\\n::ng-deep .previewSave > * {\\n pointer-events: none !important;\\n}\\n\\n.mat-dialog-actions {\\n float: right;\\n}\\n\\nh1 {\\n font-family: 'Montserrat', sans-serif;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY29uZmlybS1zYXZlL2NvbmZpcm0tc2F2ZS5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0Usd0JBQXdCLEVBQUUsYUFBYTtFQUN2QyxvQkFBYTtFQUFiLGFBQWE7RUFDYixhQUFhO0VBQ2IsVUFBVTtFQUNWLGN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lICFpbXBvcnRhbnQ7XG59XG5cbi5tYXQtZGlhbG9nLWFjdGlvbnMge1xuICBmbG9hdDogcmlnaHQ7XG59XG5cbmgxIHtcbiAgZm9udC1mYW1pbHk6ICdNb250c2VycmF0Jywgc2Fucy1zZXJpZjtcbn0iXX0= */\"","module.exports = \"

\\n Save a static image of this page to a PowerChart clinical note?\\n

\\n
Preview:
\\n
\\n
\\n \\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {AfterViewInit, Component, Inject} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material';\n\n@Component({\n selector: 'app-confirm-save',\n templateUrl: './confirm-save.component.html',\n styleUrls: ['./confirm-save.component.css']\n})\nexport class ConfirmSaveComponent implements AfterViewInit {\n innerHtml: string;\n constructor(\n public dialogRef: MatDialogRef,\n @Inject(MAT_DIALOG_DATA) readonly data: HTMLCanvasElement) {}\n\n ngAfterViewInit() {\n this.data.setAttribute('id', 'previewImg');\n this.data.setAttribute('style', 'width:500px');\n document.getElementById('previewCanvas').appendChild(this.data);\n }\n\n // The user does not wish to save the snapshot.\n onExit() {\n this.dialogRef.close();\n }\n\n // The user wishes to save the snapshot.\n onConfirm() {\n this.dialogRef.close({\n save: true,\n });\n }\n}\n","module.exports = \".configurationCard {\\n background-color: transparent;\\n border-left-style: solid;\\n border-left-width: 5px;\\n height: 40px !important;\\n padding: 3px;\\n}\\n\\n\\n.disableDragging {\\n color: gray;\\n cursor: not-allowed;\\n padding-top: 4px;\\n}\\n\\n\\n.listItem {\\n display: inline-block;\\n height: -webkit-fit-content;\\n height: -moz-fit-content;\\n height: fit-content;\\n padding-left: 5px !important;\\n}\\n\\n\\n.label {\\n height: -webkit-fit-content;\\n height: -moz-fit-content;\\n height: fit-content;\\n line-height: 15px;\\n}\\n\\n\\n.tinytext {\\n font-size: 12px;\\n line-height: 15px;\\n}\\n\\n/*# sourceMapping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c3BsYXk6IGlubGluZS1ibG9jaztcbiAgaGVpZ2h0OiBmaXQtY29udGVudDtcbiAgcGFkZGluZy1sZWZ0OiA1cHggIWltcG9ydGFudDtcbn1cblxuLmxhYmVsIHtcbiAgaGVpZ2h0OiBmaXQtY29udGVudDtcbiAgbGluZS1oZWlnaHQ6IDE1cHg7XG59XG5cbi50aW55dGV4dCB7XG4gIGZvbnQtc2l6ZTogMTJweDtcbiAgbGluZS1oZWlnaHQ6IDE1cHg7XG59XG4iXX0= */\"","module.exports = \"
\\n \\n \\n
\\n
\\n
\\n {{axisGroup.label}}\\n
\\n
\\n {{uiConstants.NO_DATA_AVAILABLE_TMPL + appTimeIntervalString}}\\n
\\n
\\n
\\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {AfterViewInit, Component, Inject, Input} from '@angular/core';\nimport {APP_TIMESPAN, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {AxisGroup} from '../graphtypes/axis-group';\n\n/**\n * Represents one element in a list or menu of ResourceCodesForCards\n * that can be added to the main CardContainer.\n */\n@Component({\n selector: 'app-data-selector-element',\n templateUrl: './data-selector-element.component.html',\n styleUrls: ['./data-selector-element.component.css']\n})\nexport class DataSelectorElementComponent implements AfterViewInit {\n /**\n * The ResourceCodes for the card represented by this DataSelectorElement.\n */\n @Input() axisGroup: AxisGroup;\n\n /**\n * Hold an instance of the app time interval so we can display it in the HTML\n */\n readonly appTimeIntervalString = APP_TIMESPAN.start.toFormat('MM/dd/yyyy') +\n ' and ' + APP_TIMESPAN.end.toFormat('MM/dd/yyyy');\n\n /**\n * Whether there is data available within the app timespan for this card.\n */\n dataAvailable = true;\n\n constructor(@Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n ngAfterViewInit() {\n // We have to wait until after view initialization so that the @Input\n // element binding happens.\n this.axisGroup.dataAvailableInAppTimeScope().then(available => {\n this.dataAvailable = available;\n });\n }\n}\n","module.exports = \".addCardInline {\\n color: rgb(248, 248, 248);\\n display: inline-block;\\n opacity: 0.15;\\n -webkit-transition: opacity 0.3s;\\n transition: opacity 0.3s;\\n /* Needed so that there's not enough space between the cards to hold the icon,\\n just enough to hold the line placeholder.*/\\n margin-bottom:-14px;\\n margin-top:-14px;\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox; /* For IE10 */\\n -webkit-box-orient: horizontal;\\n -webkit-box-direction: normal;\\n flex-direction: row; /* For IE10 */\\n align-content: center;\\n -ms-flex-line-pack: center; /* Align content: center conversion for IE10 */\\n -webkit-box-pack: start;\\n justify-content: flex-start;\\n -ms-flex-pack: start; /* Justify content: start conversion for IE10 */\\n -webkit-box-align: center;\\n align-items: center;\\n -ms-flex-align: center; /* Align items: center conversion for IE10 */\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n}\\n\\nspan {\\n border: 2px dashed rgb(248, 248, 248);\\n /* Only outline the bottom instead of all four sides.*/\\n border-style: none none dotted;\\n display: inline-block;\\n -webkit-box-flex: 1;\\n flex: 1 1 0%;\\n -ms-flex: 1 1 0%; /* For IE10 */\\n}\\n\\n.addCardInline:hover {\\n opacity: 1;\\n}\\n\\n.conceptSelector {\\n padding-left: 0px !important;\\n padding-right: 0px !important;\\n min-width: 200px;\\n}\\n\\n.mainConceptSelector {\\n border-left-style: solid;\\n border-left-width: 5px;\\n}\\n\\n::ng-deep .mat-menu-item {\\n line-height: 20px !important;\\n}\\n\\n::ng-deep .mat-list-item-content {\\n margin-top: 8px;\\n}\\n\\n::ng-deep .mat-autocomplete-panel .mat-list-item-content {\\n margin-top: -8px; /* Styling for autocomplete menu items needs to be different.*/\\n}\\n\\n::ng-deep .mat-option {\\n height: -webkit-fit-content !important;\\n height: -moz-fit-content !important;\\n height: fit-content !important;\\n overflow: visible !important;\\n padding: 0px !important;\\n}\\n\\n.conceptForm {\\n margin-left: 10px;\\n margin-right: 10px;\\n}\\n\\n::ng-deep .autoMenu.mat-menu-panel {\\n min-width: 300px;\\n}\\n\\n.conceptFormField {\\n width: 100%;\\n}\\n\\nbutton {\\n font-family: 'Work Sans', sans-serif;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvZGF0YS1zZWxlY3Rvci1tZW51L2RhdGEtc2VsZWN0b3ItbWVudS5jb21wb25lbnQuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0VBQ0UseUJBQXlCO0VBQ3pCLHFCQUFxQjtFQUNyQixhQUFhO0VBQ2IsZ0NBQXdCO0VBQXhCLHdCQUF3QjtFQUN4Qjs0Q0FDMEM7RUFDMUMsbUJBQW1CO0VBQ25CLGdCQUFnQjtFQUNoQixvQkFBYTtFQUFiLGFBQWE7RUFDYixvQkFBb0IsRUFBRSxhQUFhO0VBQ25DLDhCQUFtQjtFQUFuQiw2QkFBbUI7VUFBbkIsbUJBQW1CLEVBQ00sYUFBYTtFQUN0QyxxQkFBcUI7RUFDckIsMEJBQTBCLEdBQUcsOENBQThDO0VBQzNFLHVCQUEyQjtVQUEzQiwyQkFBMkI7RUFDM0Isb0JBQW9CLEdBQUcsK0NBQStDO0VBQ3RFLHlCQUFtQjtVQUFuQixtQkFBbUI7RUFDbkIsc0JBQXNCLEdBQUcsNENBQTRDO0VBQ3JFLG1CQUFZO1VBQVosWUFBWTtFQUNaLGdCQUFnQixFQUFFLGFBQWE7QUFDakM7O0FBRUE7RUFDRSxxQ0FBcUM7RUFDckMsc0RBQXNEO0VBQ3RELDhCQUE4QjtFQUM5QixxQkFBcUI7RUFDckIsbUJBQVk7VUFBWixZQUFZO0VBQ1osZ0JBQWdCLEVBQUUsYUFBYTtBQUNqQzs7QUFFQTtFQUNFLFVBQVU7QUFDWjs7QUFFQTtFQUNFLDRCQUE0QjtFQUM1Qiw2QkFBNkI7RUFDN0IsZ0JBQWdCO0FBQ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","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, Inject, OnInit, Output, ViewChild} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {MatAutocompleteTrigger, MatMenuTrigger} from '@angular/material';\nimport {Observable} from 'rxjs';\nimport {map, startWith} from 'rxjs/operators';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\nimport {ResourceCodeManager} from '../clinicalconcepts/resource-code-manager';\nimport {AxisGroup} from '../graphtypes/axis-group';\n\n/**\n * Shows a button with expanding menus for selecting data elements to display.\n */\n@Component({\n selector: 'app-data-selector-menu',\n templateUrl: './data-selector-menu.component.html',\n styleUrls: ['./data-selector-menu.component.css']\n})\nexport class DataSelectorMenuComponent implements OnInit {\n // The trigger for the main menu displayed.\n @ViewChild(MatMenuTrigger) menuTrigger: MatMenuTrigger;\n // The trigger for the autocomplete panel displayed.\n @ViewChild(MatAutocompleteTrigger)\n autocompleteTrigger: MatAutocompleteTrigger;\n\n // An array of DisplayGroupings and AxisGroup that belong to that\n // grouping.\n readonly displayGroupings: Array<[DisplayGrouping, AxisGroup[]]>;\n\n // An event that is emitted when the user requests to add a new card.\n @Output() addCard = new EventEmitter();\n // An event that is emitted when the user requests to add a textbox.\n @Output() addTextbox = new EventEmitter();\n // An event that is emitted when the user requests to add a custom timeline.\n @Output() addCustomTimeline = new EventEmitter();\n\n // All AxisGroup that correspond to cards displayed on the page.\n readonly allConcepts: AxisGroup[];\n\n // The FormControl used to monitor changes in the user input of the\n // autocomplete field.\n readonly conceptCtrl = new FormControl();\n filteredConcepts: Observable;\n constructor(\n private resourceCodeManager: ResourceCodeManager,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n const displayGroups = resourceCodeManager.getDisplayGroupMapping();\n const temp = Array.from(displayGroups.values());\n this.allConcepts = [].concat.apply([], temp);\n this.displayGroupings = Array.from(displayGroups.entries());\n }\n\n ngOnInit() {\n // Watch for changes to the user input on the autocomplete panel.\n this.filteredConcepts = this.conceptCtrl.valueChanges.pipe(\n startWith(''), // The autocomplete input starts with nothing typed in.\n map(concept =>\n concept ? this.filter(concept) : this.allConcepts.slice()));\n }\n\n // Listens for an event indicating that the user has selected to add the\n // concept card from the top toolbar. The label for the card is sent as an\n // event to CardContainer.\n private addConceptCard(label: string) {\n this.addCard.emit(label);\n\n recordGoogleAnalyticsEvent('addConcept', 'addCard', label);\n }\n\n // Emits an event indicating to CardContainer to add a blank textbox at the\n // top of the page.\n private textbox() {\n this.addTextbox.emit();\n\n recordGoogleAnalyticsEvent(\n 'addTextbox', 'addCard', new Date().toDateString());\n }\n\n private customTimeline() {\n this.addCustomTimeline.emit();\n\n recordGoogleAnalyticsEvent(\n 'addCustomTimeline', 'addCard', new Date().toDateString());\n }\n\n // Filter the concepts shown on the autocomplete menu.\n filter(concept): AxisGroup[] {\n return this.allConcepts.filter(\n option =>\n option.label.toLowerCase().indexOf(concept.toLowerCase()) === 0);\n }\n\n // We close the menu after an option is selected by autocomplete.\n private closeMenus() {\n this.menuTrigger.closeMenu();\n this.autocompleteTrigger.closePanel();\n }\n\n // Listen for the event indicating that an option has been selected in the\n // autocomplete menu.\n private selectOption($event) {\n this.addConceptCard($event.option.value);\n this.closeMenus();\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Duration, Interval} from 'luxon';\n/**\n * For the given date range, returns a DateTime for each day in the time\n * range (converting to local time first) as a list in chronological\n * order. All data points in dateRange will be enclosed by the days listed in\n * the returned array. If specified, additional DateTimes will be included at\n * the 12-hour mark of each day in the interval.\n * @param dateRange The date range to get tick marks for.\n * @param twelveHour Whether or not to include DateTimes at the 12-hour mark of\n * each day.\n *\n * @returns A list of the days in chronological order within the time range.\n */\nexport function getTickMarksForXAxis(\n dateRange: Interval, twelveHour: boolean): DateTime[] {\n const days: DateTime[] = [];\n // The dateRange could be stored in UTC, so convert it back to local\n // time.\n const intervalLocal = Interval.fromDateTimes(\n dateRange.start.toLocal(), dateRange.end.toLocal());\n const startDate: DateTime = intervalLocal.start.startOf('day');\n const dayCount =\n Duration.fromMillis(intervalLocal.end.toMillis() - startDate.toMillis())\n .as('days');\n\n for (let i = 0; i <= dayCount; i++) {\n days.push(startDate.plus({days: i}));\n if (twelveHour) {\n days.push(startDate.plus({days: i, hours: 12}));\n }\n }\n\n return days;\n}\n\n/**\n * Returns a DateTime for each day contained in any of the intervals in the\n * passed-in interval set. If the interval set contains day-boundaries, it will\n * add an extra day to be sure to encompass the full day, like\n * getTickMarksForXAxis. The days returned will be in an array in time order.\n *\n * @param intervals The intervals to list all the days for.\n */\nexport function getDaysForIntervalSet(intervals: Interval[]): DateTime[] {\n const days: DateTime[] = [];\n const allIntervals = Interval.merge(intervals);\n for (const interval of allIntervals) {\n getTickMarksForXAxis(interval, false).forEach(x => days.push(x.toUTC()));\n }\n return days.sort();\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Injectable} from '@angular/core';\n\n/**\n * This service accumulates any errors sent to it in the app into an array of\n * strings so that they can be surfaced in the UI.\n */\n@Injectable({providedIn: 'root'})\nexport class DebuggerService {\n errors: string[] = [];\n\n logError(error: string) {\n this.errors.push(error);\n }\n}\n","module.exports = \"
\\n Browser version: {{browserVersion}}
\\n Authentication information:
\\n URL Parameters: {{parameters}}
\\n\\n Errors surfaced:
\\n
\\n {{error}}\\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nimport 'fhirclient';\n\nimport {Component} from '@angular/core';\nimport {ActivatedRoute} from '@angular/router';\n\nimport {DebuggerService} from '../debugger.service';\n\n@Component({\n selector: 'app-debugger',\n templateUrl: './debugger.component.html',\n})\n\n/**\n * This debugger component surfaces errors stored in the debug service to the\n * UI.\n */\nexport class DebuggerComponent {\n browserVersion: string;\n parameters = new Array();\n\n constructor(\n readonly debugService: DebuggerService, private route: ActivatedRoute) {\n this.browserVersion = navigator.appVersion;\n\n this.route.queryParams.subscribe(params => {\n this.parameters.push(JSON.stringify(params));\n });\n }\n}\n","module.exports = \"

{{uiConstants.REMOVE_CARD}}

\\n
\\n \\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, Inject} from '@angular/core';\nimport {MatDialogRef} from '@angular/material/dialog';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\n/**\n * Shows a dialog asking the user to confirm whether or not they wish to delete\n * the card.\n */\n@Component({\n selector: 'app-delete-dialog',\n templateUrl: './delete-dialog.component.html',\n styleUrls: ['../cardcontainer/cardcontainer.component.css']\n})\nexport class DeleteDialogComponent {\n constructor(\n public dialogRef: MatDialogRef,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n // The user does not wish to delete the card.\n onExit() {\n this.dialogRef.close();\n }\n\n // The user wishes to delete the card.\n onConfirm() {\n this.dialogRef.close({\n delete: true,\n });\n }\n}\n","// Copyright 2019 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\n\nimport {TimestampedObject} from '../fhir-resource-set';\nimport {DiagnosticReport} from './diagnostic-report';\n\n/**\n * A diagnostic report with the timestamp for a specific culture type extended.\n */\nexport class AnnotatedDiagnosticReport extends TimestampedObject {\n readonly report: DiagnosticReport;\n\n constructor(report: DiagnosticReport) {\n // Get the timestamp from the collection time of the specimen.\n const specimen = report.specimen;\n let timestamp;\n if (specimen) {\n timestamp = specimen.collectedDateTime ?\n specimen.collectedDateTime :\n (specimen.collectedPeriod ? specimen.collectedPeriod.start :\n undefined);\n }\n super(timestamp);\n this.report = report;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Duration, Interval} from 'luxon';\nimport {ResultClassWithTimestamp} from '../fhir-resource-set';\nimport {MedicationOrder, MedicationOrderSet} from './medication-order';\nimport {Observation} from './observation';\nimport {ObservationSet} from './observation-set';\n\n/**\n * An Observation with additional information to display in its tooltip.\n */\nexport class AnnotatedObservation extends ResultClassWithTimestamp {\n constructor(\n readonly observation: Observation,\n /**\n * The items in this list are [label, value] pairs to be displayed in\n * a tooltip.\n * This array should be treated as immutable.\n */\n readonly annotationValues = new Array<[string, string]>()) {\n super(observation.label, observation.requestId, observation.timestamp);\n }\n\n /**\n * Makes an AnnotatedObservation for medication monitoring.\n * The annotations read out how long it's been since the prior medication\n * dose, and how long it was until the next medication dose was given.\n * @param observation The monitoring observation to annotate\n * @param medicationOrderSet The medication orders containing the doses of the\n * corresponding medication\n * @throws Error if there are two medication orders in MedicationOrderSet\n * that contain the timestamp of the observation\n */\n static forMedicationMonitoring(\n observation: Observation,\n medicationOrderSet: MedicationOrderSet): AnnotatedObservation {\n // Look in the medication order set's administrations and find the ones\n // closest in time to this observation.\n let doseCountBefore: number;\n let doseCountAfter: number;\n let timeSinceLast: Duration;\n let timeBeforeNext: Duration;\n\n const annotations = new Array<[string, string]>();\n // Find the medication order set that coincides in time with this\n // administration (if any).\n let containingMedicationOrder: MedicationOrder;\n for (const order of medicationOrderSet.resourceList) {\n if (Interval\n .fromDateTimes(\n order.firstAdministration.timestamp,\n order.lastAdmininistration.timestamp)\n .contains(observation.timestamp)) {\n if (containingMedicationOrder) {\n throw Error('Two medication orders contain this monitoring point.');\n }\n containingMedicationOrder = order;\n }\n }\n\n if (containingMedicationOrder) {\n // Find the spot in the array of administrations where the monitoring\n // would fall, timewise.\n const sortedAdmins =\n containingMedicationOrder.administrationsForOrder.resourceList.sort(\n (a, b) => a.medAdministration.timestamp.toMillis() -\n b.medAdministration.timestamp.toMillis());\n\n let idx = 0;\n while (idx < sortedAdmins.length &&\n sortedAdmins[idx].medAdministration.timestamp <\n observation.timestamp) {\n idx++;\n }\n\n // It's guaranteed that there's a dose before the monitoring point and a\n // dose after the monitoring point since we check to make sure\n // the observation is between the first and last administrations.\n // Here we look up those dose numbers and the time difference between\n // the doses and the monitoring point.\n const doseBeforeObs = sortedAdmins[idx - 1];\n const doseAfterObs = sortedAdmins[idx];\n\n doseCountBefore = doseBeforeObs.doseInOrder;\n timeSinceLast =\n observation.timestamp.diff(doseBeforeObs.medAdministration.timestamp);\n\n doseCountAfter = doseAfterObs.doseInOrder;\n timeBeforeNext =\n doseAfterObs.medAdministration.timestamp.diff(observation.timestamp);\n\n annotations.push([\n 'Time since dose #' + doseCountBefore, timeSinceLast.toFormat('h:mm')\n ]);\n\n annotations.push([\n 'Time before dose #' + doseCountAfter, timeBeforeNext.toFormat('h:mm')\n ]);\n }\n\n return new AnnotatedObservation(observation, annotations);\n }\n\n /**\n * Makes an AnnotatedObservation for blood pressure, with information about\n * the blood pressure location.\n * @param observation The monitoring observation to annotate\n * @param locationSet The ObservationSet containing Blood Pressure location\n * observations.\n * @throws Error if there are two observations in locationSet\n * that contain the timestamp of the observation\n */\n static forBloodPressure(\n observation: Observation,\n locationSet: ObservationSet): AnnotatedObservation {\n const annotations = new Array<[string, string]>();\n // Find the medication order set that coincides in time with this\n // administration (if any).\n if (locationSet) {\n for (const locationObs of locationSet.resourceList) {\n if (locationObs.observation.timestamp.equals(observation.timestamp)) {\n annotations.push(\n ['Blood Pressure Location', locationObs.observation.result]);\n }\n }\n }\n\n return new AnnotatedObservation(observation, annotations);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\nimport {FhirResourceType} from '../../constants';\nimport {BCHMicrobioCodeGroup} from '../clinicalconcepts/bch-microbio-code';\nimport {ResourceCode} from '../clinicalconcepts/resource-code-group';\nimport {ResultError} from '../result-error';\n\nimport {Observation} from './observation';\nimport {Specimen} from './specimen';\n\n/**\n * FHIR element for DiagnosticReportStatus, from the DSTU2 version of the\n * standard.\n * https://www.hl7.org/fhir/valueset-diagnostic-report-status.html\n */\nexport enum DiagnosticReportStatus {\n Registered = 'Registered',\n Partial = 'Partial',\n Preliminary = 'Preliminary',\n Final = 'Final',\n Amended = 'Amended',\n Corrected = 'Corrected',\n Appended = 'Appended',\n Cancelled = 'Cancelled',\n EnteredInError = 'Enteredinerror',\n Unknown = 'Unknown'\n}\n\nconst statusToEnumMap = new Map([\n ['registered', DiagnosticReportStatus.Registered],\n ['partial', DiagnosticReportStatus.Partial],\n ['preliminary', DiagnosticReportStatus.Preliminary],\n ['final', DiagnosticReportStatus.Final],\n ['amended', DiagnosticReportStatus.Amended],\n ['corrected', DiagnosticReportStatus.Corrected],\n ['appended', DiagnosticReportStatus.Appended],\n ['cancelled', DiagnosticReportStatus.Cancelled],\n ['entered-in-error', DiagnosticReportStatus.EnteredInError],\n ['unknown', DiagnosticReportStatus.Unknown],\n]);\n\n/**\n * FHIR resource for DiagnosticReport, from the DSTU2 version of the standard.\n * https://www.hl7.org/fhir/DSTU2/diagnosticreport.html\n *\n * The parsing for this class is heavily influenced by the custom API BCH\n * built to return DiagnosticReports for microbiology data. In particular, we\n * only parse out specimens and results from the \"contained\" portion of the\n * resource instead of supporting retrieval by reference since the Cerner\n * implementation of the FHIR standard won't allow microbiology retrieval.\n */\nexport class DiagnosticReport {\n readonly id: string;\n\n /** Specimen this report is based on */\n readonly specimen: Specimen;\n\n /** Results in the form of observations */\n readonly results = new Array();\n\n /** Status for this test */\n readonly status: DiagnosticReportStatus;\n\n /** Request ID of the request that obtained this report data */\n readonly requestId: string;\n\n constructor(json: any, requestId: string) {\n this.requestId = requestId;\n\n if (json.id) {\n this.id = json.id;\n }\n\n // Contained resources may be either specimens or observations.\n const contained = json.contained;\n const specimens = [];\n for (const rsc of contained) {\n if (rsc.resourceType === FhirResourceType.Specimen) {\n specimens.push(new Specimen(rsc, this.requestId));\n } else if (rsc.resourceType === FhirResourceType.Observation) {\n try {\n this.results.push(new Observation(rsc, this.requestId));\n } catch (err) {\n // silently ignore observations within diagnostic reports that have\n // errors. Errors may occur because an observation may not have a\n // LOINC code we recognize or may have an inconsistent label.\n // Please see Observation constructor for all error cases.\n console.log(err);\n }\n }\n // Silently ignore all other contained resource types.\n }\n if (specimens.length > 1) {\n throw new ResultError(\n new Set([this.requestId]),\n 'The report cannot have multiple specimens.');\n }\n this.specimen = specimens[0];\n\n if (!json.status) {\n throw new ResultError(\n new Set([this.requestId]),\n 'The report needs a status to be useful.' + json);\n }\n\n this.status = statusToEnumMap.get(json.status);\n }\n\n /**\n * The custom microbiology API provided does not allow for calling for\n * a specific microbio code, so this function parses the entire anticipated\n * JSON repsonse and filters by code.\n * @param json The JSON retrieved from the server.\n * @param codeGroup The CodeGroup of tests we're looking for.\n */\n static parseAndFilterMicrobioData(json: any, codeGroup: BCHMicrobioCodeGroup):\n Array {\n if (!json || !json.entry) {\n return [];\n }\n // We cannot get the request ID from the Microbiology response. Therefore\n // we hardcode the request ID to just be a constant string.\n const requestId = 'Microbiology Request';\n\n const diagnosticReports: DiagnosticReport[] = json.entry.map(\n result => new DiagnosticReport(result.resource, requestId));\n\n const mapToUpdate = new Map();\n // Get all unique codes for all DiagnosticReport results.\n for (const report of diagnosticReports) {\n const codes: ResourceCode[] =\n report.results.map(r => r.codes)\n .reduce((prev: ResourceCode[], curr: ResourceCode[]) => {\n return prev.concat(curr);\n }, []);\n const uniqueCodes: ResourceCode[] = Array.from(new Set(codes));\n for (const code of uniqueCodes) {\n let existing = mapToUpdate.get(code);\n if (!existing) {\n existing = [];\n }\n existing.push(report);\n mapToUpdate.set(code, existing);\n }\n }\n let reports = new Array();\n for (const code of codeGroup.resourceCodes) {\n if (mapToUpdate.has(code)) {\n reports = reports.concat(mapToUpdate.get(code));\n }\n }\n return reports;\n }\n}\n","import {fixUnitAbbreviations} from '../unit_utils';\n\n// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/**\n * This object represents relevant components of dosage information, provided\n * in MedicationOrders and MedicationAdministrations.\n */\nexport class Dosage {\n readonly quantity: number;\n readonly unit: string;\n readonly route: string;\n readonly text: string;\n\n constructor(json: any) {\n if (json.dosage) {\n if (json.dosage.quantity) {\n this.quantity = json.dosage.quantity.value;\n this.unit = fixUnitAbbreviations(json.dosage.quantity.unit);\n }\n if (json.dosage.route) {\n this.route = json.dosage.route.text;\n }\n /*\n * The text for the dosage usually contains information about the rate of\n * administration, however the format across different\n * MedicationAdministrations is not consistent. Ex: \"500 mg IV q6hr\" vs\n * \"250 mg = 1 caps Oral Once\"\n */\n this.text = json.dosage.text;\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\nimport {ResultError} from './../result-error';\n\n/**\n * This object represents basic information about an Encounter: what its\n * reason and type were, when it happened, and its ID.\n */\nexport class Encounter {\n readonly encounterId: string;\n readonly period: Interval;\n readonly requestId: string;\n\n constructor(private json: any, requestId: string) {\n this.encounterId = json.id;\n this.requestId = requestId;\n\n if (!json.period) {\n throw new ResultError(\n new Set([this.requestId]), 'An encounter must have a time period.',\n json);\n }\n\n if (!json.period.start) {\n throw new ResultError(\n new Set([this.requestId]), 'An encounter must have a start date.',\n json);\n }\n const startTime = DateTime.fromISO(json.period.start).toLocal();\n\n let endTime = json.period.end ?\n DateTime.fromISO(json.period.end).toLocal() :\n undefined;\n if (endTime === undefined || (endTime > DateTime.local())) {\n endTime = DateTime.local();\n }\n\n if (endTime < startTime) {\n throw new ResultError(\n new Set([this.requestId]),\n 'The start time comes before the end time.', json);\n }\n if (startTime > DateTime.local()) {\n throw new ResultError(\n new Set([this.requestId]), 'The start time is in the future.', json);\n }\n this.period = Interval.fromDateTimes(startTime, endTime);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime} from 'luxon';\nimport {FhirResourceType} from 'src/constants';\n\nimport {RxNormCode} from '../clinicalconcepts/rx-norm';\nimport {FhirResourceSet, ResultClass, ResultClassWithTimestamp} from '../fhir-resource-set';\nimport {fixUnitAbbreviations} from '../unit_utils';\nimport {ResultError} from './../result-error';\n\nimport {Dosage} from './dosage';\nimport {ContainedMedication} from './medication';\n\n\n/**\n * This object represents a FHIR MedicationAdministration. It does not contain\n * all the information in a standard MedicationAdministration (see\n * https://www.hl7.org/fhir/DSTU2/medicationadministration.html) but instead\n * stores only the information we're interested in seeing.\n */\nexport class MedicationAdministration extends ResultClassWithTimestamp {\n readonly MED_RESOURCE_TYPE = 'Medication';\n readonly rxNormCode: RxNormCode;\n readonly timestamp: DateTime;\n readonly wasNotGiven: boolean;\n readonly dosage: Dosage;\n readonly medicationOrderId: string;\n readonly containedMedications: ContainedMedication[] = [];\n\n /**\n * Makes an MedicationAdministration out of a JSON object that represents a\n * a FHIR MedicationAdministration.\n * https://www.hl7.org/fhir/DSTU2/medicationadministration.html\n * @param json A JSON object that represents a FHIR MedicationAdministration.\n * @param requestId The x-request-id of the request that acquired this\n * medication administration's data.\n */\n constructor(private json: any, requestId: string) {\n super(\n json.medicationReference ? json.medicationReference.display :\n json.medicationCodeableConcept ?\n json.medicationCodeableConcept.text :\n null,\n requestId,\n json.effectiveTimeDateTime ?\n DateTime.fromISO(json.effectiveTimeDateTime).toUTC() :\n json.effectiveTimePeriod ?\n DateTime.fromISO(json.effectiveTimePeriod.start).toUTC() :\n null);\n this.rxNormCode = ResultClass.extractMedicationEncoding(json);\n\n this.dosage = new Dosage(json);\n this.wasNotGiven = json.wasNotGiven;\n this.medicationOrderId = json.prescription && json.prescription.reference ?\n json.prescription.reference.replace(\n FhirResourceType.MedicationOrder + '/', '') :\n null;\n\n if (json.contained && json.contained.length > 0) {\n // We first find the element that lists the \"ingredients\" of this\n // MedicationAdministration with each corresponding dosage and reference\n // id. This element of \"contained\" will have the same id as the overall\n // MedicationAdministration's medicationReference number.\n const referenceId =\n json.medicationReference ? json.medicationReference.reference : null;\n\n const ingredientReferences = new Map();\n if (referenceId) {\n const index = json.contained.findIndex(\n el =>\n (el.resourceType === this.MED_RESOURCE_TYPE && el.product &&\n el.id === referenceId.replace('#', '')));\n const listOfIngredients = json.contained[index];\n if (listOfIngredients && listOfIngredients.product.ingredient) {\n for (const el of listOfIngredients.product.ingredient) {\n if (el.item && el.amount) {\n ingredientReferences.set(el.item.reference.replace('#', ''), el);\n }\n }\n }\n // Remove the element similar to a \"list of ingredients\" from contained.\n if (index > -1) {\n json.contained.splice(index, 1);\n }\n }\n if (ingredientReferences.size > 0 && json.contained.length > 1) {\n // We map the Medications in the list of ingredients to JSON elements\n // containing the RxNorms for each ingredient.\n for (const ing of json.contained) {\n this.containedMedications.push(new ContainedMedication(\n ing, ingredientReferences, this.requestId));\n }\n }\n }\n\n if (!(this.rxNormCode && this.label)) {\n // If a MedicationAdministration has \"Contained\" portions of different\n // ingredients, then there might not be one single RxNorm corresponding to\n // this administration.\n\n // We throw an error if all contained medications do not\n // have an RxNormCode, or if there are no contained medications.\n if (this.containedMedications.length === 0 ||\n (this.containedMedications.length > 0 &&\n this.containedMedications.every(med => (med.code === undefined)))) {\n throw new ResultError(\n new Set([this.requestId]),\n 'JSON must include RxNormCode and a label' +\n ' to be included as a MedicationAdministration.',\n json);\n }\n }\n }\n}\n\n/**\n * A set of MedicalAdministrations that belong together as part of the same\n * series.\n */\nexport class MedicationAdministrationSet extends\n FhirResourceSet {\n readonly maxDose: number;\n readonly minDose: number;\n readonly unit: string;\n readonly rxNormCode: RxNormCode;\n\n /**\n * Constructor for MedicationAdministrationSet.\n * @param medicationAdministrationList The list of MedicationAdministrations\n * belonging together.\n * @throws Error if the administrations have different labels or RxNorms,\n * or if there is not a label, or if the administrations have different\n * units.\n */\n constructor(medicationAdministrationList: AnnotatedAdministration[]) {\n super(medicationAdministrationList);\n\n const requestIdsString = Array.from(this.requestIds).join(', ');\n\n const rxNorms =\n medicationAdministrationList.map(x => x.medAdministration.rxNormCode);\n if (new Set(rxNorms).size > 1) {\n throw new ResultError(\n this.requestIds,\n `Different RxNorms for administrations: ${rxNorms}.`);\n }\n this.rxNormCode = rxNorms[0];\n\n this.minDose = Math.min(...medicationAdministrationList.map(\n x => x.medAdministration.dosage.quantity));\n this.maxDose = Math.max(...medicationAdministrationList.map(\n x => x.medAdministration.dosage.quantity));\n\n const units = new Set(\n medicationAdministrationList.map(x => x.medAdministration.dosage.unit));\n if (units.size > 1) {\n throw new ResultError(\n this.requestIds,\n `Different units in the administration set: ${\n Array.from(units.values())}.`);\n }\n this.unit = fixUnitAbbreviations(Array.from(units.values())[0]);\n }\n}\n\n/**\n * A MedicationAdministration with additional information relating it to\n * the other administrations in the same order.\n */\nexport class AnnotatedAdministration extends ResultClass {\n /** The medication administration to be annotated. */\n readonly medAdministration: MedicationAdministration;\n\n /**\n * The dose number for this administration in this order. The first dose is\n * numbered 1.\n */\n readonly doseInOrder: number;\n\n /**\n * The numbered day for this dose within this order. The first dose will\n * be on day 1. Day 2 starts 24 hours after the first dose administration,\n * day 3 24 hours after that, etc.\n */\n readonly doseDay: number;\n\n /**\n * The annotated dose for the dose prior to this one. Undefined if this is\n * the first dose.\n */\n readonly previousDose: AnnotatedAdministration;\n\n constructor(\n medAdmin: MedicationAdministration, doseInOrder: number, doseDay: number,\n prevDose?: AnnotatedAdministration) {\n super(medAdmin.label, medAdmin.requestId);\n this.medAdministration = medAdmin;\n this.doseInOrder = doseInOrder;\n this.doseDay = doseDay;\n this.previousDose = prevDose;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Disable this check because it's for IE 11 compatibility and we're not worried\n// about that in our testing code.\n/* tslint:disable:object-literal-shorthand*/\n\nimport {MedicationConceptGroup, RxNormCode} from '../clinicalconcepts/rx-norm';\nimport {FhirResourceSet, ResultClass} from '../fhir-resource-set';\nimport {FhirService} from '../fhir.service';\nimport {fixUnitAbbreviations} from '../unit_utils';\nimport {ResultError} from './../result-error';\n\nimport {AnnotatedAdministration, MedicationAdministration, MedicationAdministrationSet} from './medication-administration';\n\n/**\n * FHIR element for MedicationOrderStatus, from the DSTU2 version of the\n * standard.\n * http://hl7.org/fhir/DSTU2/valueset-medication-order-status.html\n */\nexport const MedicationOrderStatus = {\n ACTIVE: 'active',\n ON_HOLD: 'on-hold',\n COMPLETED: 'completed',\n ENTERED_IN_ERROR: 'entered-in-error',\n STOPPED: 'stopped',\n DRAFT: 'draft',\n}\n\n/**\n * This object represents a FHIR MedicationOrder. It does not contain\n * all the information in a standard MedicationOrder (see\n * https://www.hl7.org/fhir/DSTU2/medicationorder.html) but instead\n * stores only the information we're interested in seeing.\n */\nexport class MedicationOrder extends ResultClass {\n readonly rxNormCode: RxNormCode;\n readonly dosageRetrievalError = 'Could not retrieve dosage instructions.';\n firstAdministration: MedicationAdministration;\n lastAdmininistration: MedicationAdministration;\n administrationsForOrder: MedicationAdministrationSet;\n readonly status: string;\n readonly orderId: string;\n\n // By default, we set the instruction message as the retrieval error message,\n // and change it if we find a valid dosage instruction.\n dosageInstruction = this.dosageRetrievalError;\n /**\n * Makes an MedicationOrder out of a list of MedicationAdministrations.\n * https://www.hl7.org/fhir/DSTU2/medicationorder.html\n * @param json The json representing this MedicationOrder.\n * @param requestId The x-request-id of the request that acquired this\n * medication order's data.\n */\n constructor(private json: any, requestId: string) {\n // A MedicationOrder's label is one of the following in order of preference:\n // 1) the medication reference's display anme\n // 2) the medication encoding's text\n // 3) the order's ID\n super(\n json.medicationReference ? json.medicationReference.display :\n json.medicationCodeableConcept ?\n json.medicationCodeableConcept.text :\n json.id,\n requestId);\n\n if (json.dosageInstruction && json.dosageInstruction[0]) {\n if (json.dosageInstruction.length > 1) {\n throw new ResultError(\n new Set([this.requestId]),\n 'JSON must only include one dosage instruction.', json);\n }\n this.dosageInstruction = json.dosageInstruction[0].text;\n }\n this.orderId = json.id;\n this.status = json.status;\n\n this.rxNormCode = ResultClass.extractMedicationEncoding(json);\n\n if (!(this.rxNormCode && this.label)) {\n throw new ResultError(\n new Set([this.requestId]),\n 'JSON must include RxNormCode and a label to be included as a MedicationOrder.',\n json);\n }\n\n // Check this MedicationOrder label against the RxNorm label.\n if (this.label.toLowerCase() !== this.rxNormCode.label.toLowerCase()) {\n throw new ResultError(\n new Set([this.requestId]),\n `The label for this MedicationOrder's RxNorm code doesn't match ` +\n `the label in the data. MedicationOrder label: ${this.label}. ` +\n `RxNorm label: ${this.rxNormCode.label}.`);\n }\n }\n\n /**\n * Sets the MedicationAdministration info for this MedicationOrder.\n * @param fhirService The FhirService used to find the\n * MedicationAdministrations corresponding to this MedicationOrder.\n * @throws Error if the label for the list of administrations does not match\n * the label for this order.\n * @returns This order, after all the promises are resolved.\n */\n setMedicationAdministrations(fhirService: FhirService):\n Promise {\n return fhirService\n .getMedicationAdministrationsWithOrder(this.orderId, this.rxNormCode)\n .then(\n medAdmins => {\n if (!medAdmins) {\n return this;\n }\n medAdmins = medAdmins.sort((a, b) => {\n return a.timestamp.toMillis() - b.timestamp.toMillis();\n });\n this.firstAdministration = medAdmins[0];\n this.lastAdmininistration = medAdmins[medAdmins.length - 1];\n\n const admins = [];\n for (let i = 0; i < medAdmins.length; i++) {\n const admin = medAdmins[i];\n // We want the dose counts and day counts to start with 1 so we\n // add 1 to the day count and the index for the dose.\n const dayCount =\n admin.timestamp.diff(this.firstAdministration.timestamp)\n .as('day') + 1;\n const annotated = new AnnotatedAdministration(\n admin, i + 1 /* dose in order starts at 1 */, dayCount,\n i > 0 ? admins[i - 1] : undefined);\n admins.push(annotated);\n }\n this.administrationsForOrder =\n new MedicationAdministrationSet(admins);\n return this;\n },\n rejection => {\n // Throw an error if the construction of the\n // MedicationAdministration results in an error.\n throw rejection;\n });\n }\n}\n\n/**\n * A set of MedicationOrders that belong together as part of the same\n * series, representing all orders for the medicine in a given time period.\n */\nexport class MedicationOrderSet extends FhirResourceSet {\n /*\n * The RxNormCode for this set of data. All data in this set\n * must have the same RxNormCode.\n */\n readonly rxNormCode: RxNormCode;\n readonly medicationConcept: MedicationConceptGroup;\n\n readonly maxDose: number;\n readonly minDose: number;\n readonly unit: string;\n\n /**\n * Constructor for MedicationOrderSet.\n * @param MedicationOrderList The list of MedicationOrders belonging\n * together. This list is sorted by first MedicationAdministration for\n * each order.\n * @throws Error if the observations have different labels/RxNormCodes, or\n * if there is not a label/RxNormCode.\n */\n constructor(medicationOrderList: MedicationOrder[]) {\n // Sort the list by first administration.\n medicationOrderList = medicationOrderList.sort(function(a, b) {\n return a.firstAdministration.timestamp.toMillis() -\n b.firstAdministration.timestamp.toMillis();\n });\n super(medicationOrderList);\n // Set the RxNormCode and MedicationConceptGroup for this\n // MedicationOrderSet.\n if (medicationOrderList.length > 0) {\n const requestIdsString = Array.from(this.requestIds).join(', ');\n\n const firstRxNorm = medicationOrderList[0].rxNormCode;\n if (!firstRxNorm) {\n throw new ResultError(\n this.requestIds,\n 'The first resource does not have an RxNorm code.');\n }\n\n for (const rs of medicationOrderList) {\n if (rs.rxNormCode !== firstRxNorm) {\n throw new ResultError(\n this.requestIds,\n 'The resource list in this set has mixed RxNorm codes.');\n }\n }\n this.rxNormCode = firstRxNorm;\n this.medicationConcept = this.rxNormCode.displayGrouping;\n\n this.minDose = Math.min(\n ...medicationOrderList.map(x => x.administrationsForOrder.minDose));\n this.maxDose = Math.max(\n ...medicationOrderList.map(x => x.administrationsForOrder.maxDose));\n\n const units =\n new Set(medicationOrderList.map(x => x.administrationsForOrder.unit));\n if (units.size > 1) {\n throw new ResultError(\n this.requestIds,\n `Different units in the order set: ${Array.from(units.values())}`);\n }\n this.unit = fixUnitAbbreviations(Array.from(units.values())[0]);\n }\n }\n}\n/* tslint:enable:object-literal-shorthand*/\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\nimport {RxNormCode} from '../clinicalconcepts/rx-norm';\nimport {ResultClass} from '../fhir-resource-set';\nimport {ResultError} from '../result-error';\n\nimport {Dosage} from './dosage';\n\n/**\n * This object represents relevant components of a medication contained as part\n * of a MedicationAdministration.\n * This is not a FHIR resource, and differs from the defined Medication\n * documentation at http://hl7.org/fhir/dstu2/medication.html.\n */\nexport class ContainedMedication extends ResultClass {\n readonly code: RxNormCode;\n readonly dosage: Dosage;\n readonly id: string;\n constructor(json: any, ingredients: Map, requestId: string) {\n super(json.code ? json.code.text : null, requestId);\n // We want to construct new Medications for jsons containing RxNorm codes.\n if (json.resourceType !== 'Medication') {\n throw new ResultError(\n new Set([this.requestId]), 'Resource must be of type Medication',\n json);\n }\n if (json.code) {\n if (json.code.coding) {\n this.code =\n json.code.coding\n .map(\n // Map the codes to a boolean that is true only if the\n // encoding is an RxNormCode encoding, and the RxNorm code\n // appeas in our RxNormCode list that we care about.\n (coding) => (!coding.system ||\n coding.system.indexOf(\n RxNormCode.CODING_STRING) !== -1) &&\n RxNormCode.fromCodeString(coding.code))\n // Filter out any codes that are not RxNorm codes.\n .filter((code) => !!code)[0];\n }\n }\n if (!this.code) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Medication must have RxNorm code to be useful', json);\n }\n this.id = json.id;\n const reference = ingredients.get(this.id);\n if (!reference) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Medication info must have been contained in ingredient list.', json);\n }\n if (this.id) {\n // The dosage format is different for contained\n // portions of Medications.\n const dosage = {\n dosage: {\n quantity: {\n value: reference.amount.numerator ?\n reference.amount.numerator.value :\n null,\n unit: reference.amount.numerator ? reference.amount.numerator.unit :\n null\n },\n }\n };\n this.dosage = new Dosage(dosage);\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/** This is the URL for the coding system for observation interpretations. */\nexport const OBSERVATION_INTERPRETATION_VALUESET_URL =\n 'http://hl7.org/fhir/ValueSet/observation-interpretation';\n\n/**\n * These are codes corresponding to ObservationInterpretations used in\n * MicrobioGraph.\n */\nexport const CHECK_RESULT_CODE = 'CHECKRESULT';\nexport const NEGFLORA_CODE = 'NEGORFLORA';\nexport const NEG_CODE = 'NEG';\nexport const NORMAL = 'N';\n\n/**\n * Represents the possible interpretations for observations. Each interpretation\n * has a code (usually 1-3 characters) plus a text description for display.\n * This class also keeps track of a map of codes to display text.\n */\nexport class ObservationInterpretation {\n static codeToObject = new Map();\n\n readonly code: string;\n readonly display: string;\n\n constructor(code: string, display: string) {\n this.code = code;\n this.display = display;\n ObservationInterpretation.codeToObject.set(code, this);\n }\n}\n\n/**\n * These are the FHIR standard value set values.\n * http://hl7.org/fhir/valueset-observation-interpretation.html\n */\nconst STANDARD_FHIR_INTERPRETATIONS = [\n new ObservationInterpretation('<', 'Off scale low'),\n new ObservationInterpretation('>', 'Off scale high'),\n new ObservationInterpretation('A', 'Abnormal'),\n new ObservationInterpretation('A', 'Critically abnormal'),\n new ObservationInterpretation('AC', 'Anti-complementary substances present'),\n new ObservationInterpretation('B', 'Better'),\n new ObservationInterpretation('D', 'Significant change down'),\n new ObservationInterpretation('DET', 'Detected'),\n new ObservationInterpretation('H', 'High'),\n new ObservationInterpretation('HH', 'Critically high'),\n new ObservationInterpretation('HM', 'Hold for Medical Review'),\n new ObservationInterpretation('HU', 'Very high'),\n new ObservationInterpretation('I', 'Intermediate'),\n new ObservationInterpretation('IE', 'Insufficient evidence'),\n new ObservationInterpretation('IND', 'Indeterminate'),\n new ObservationInterpretation('L', 'Low'),\n new ObservationInterpretation('LL', 'Critically low'),\n new ObservationInterpretation('LU', 'Very low'),\n new ObservationInterpretation(\n 'MS',\n 'Moderately susceptible. Indicates for microbiology susceptibilities only.'),\n new ObservationInterpretation(NORMAL, 'Normal'),\n new ObservationInterpretation('ND', 'Not Detected'),\n new ObservationInterpretation(NEG_CODE, 'Negative'),\n new ObservationInterpretation('NR', 'Non-reactive'),\n new ObservationInterpretation('NS', 'Non-susceptible'),\n new ObservationInterpretation(\n 'null', 'No range defined, or normal ranges don\\'t apply'),\n new ObservationInterpretation(\n 'OBX', 'Interpretation qualifiers in separate OBX segments'),\n new ObservationInterpretation('POS', 'Positive'),\n new ObservationInterpretation('QCF', 'Quality Control Failure'),\n new ObservationInterpretation('R', 'Resistant'),\n new ObservationInterpretation('RR', 'Reactive'),\n new ObservationInterpretation('S', 'Susceptible'),\n new ObservationInterpretation('SDD', 'Susceptible-dose dependent'),\n new ObservationInterpretation('SYN-R', 'Synergy - resistant'),\n new ObservationInterpretation('SYN-S', 'Synergy - susceptible'),\n new ObservationInterpretation('TOX', 'Cytotoxic substance present'),\n new ObservationInterpretation('U', 'Significant change up'),\n new ObservationInterpretation(\n 'VS',\n 'Very susceptible. Indicates for microbiology susceptibilities only.'),\n new ObservationInterpretation('W', 'Worse'),\n new ObservationInterpretation('WR', 'Weakly reactive')\n];\n\n/**\n * This valueset is extensible, so here are some that BCH extends it with\n * for its microbiology results.\n */\nconst BCH_CUSTOM_INTERPRETATIONS = [\n new ObservationInterpretation(CHECK_RESULT_CODE, 'Check result'),\n new ObservationInterpretation(NEGFLORA_CODE, 'Negative or Flora')\n];\n\nconst ALL_INTERPRETATIONS =\n [].concat(BCH_CUSTOM_INTERPRETATIONS, STANDARD_FHIR_INTERPRETATIONS);\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime} from 'luxon';\n\nimport {FhirResourceSet} from '../fhir-resource-set';\nimport {fixUnitAbbreviations} from '../unit_utils';\n\nimport {AnnotatedObservation} from './annotated-observation';\n\n/**\n * A set of observations that belong together as part of the same series.\n */\nexport class ObservationSet extends FhirResourceSet {\n /**\n * The normal ranges for this set of observations. It maps a timestamp of each\n * Observation with a normal range to the corresponding normal range.\n */\n normalRanges = new Map();\n\n /**\n * The units for this set of observations. Left unset if the normal\n * range is different across the observations.\n */\n readonly unit: string;\n\n /**\n * Whether or not any Observations belonging to this ObservationSet contain\n * qualitative results rather than numerical values.\n */\n readonly anyQualitative: boolean = false;\n\n /**\n * Constructor for ObservationSet.\n * @param observationList The list of observations belonging together.\n * @throws Error if the observations have different labels, as this indicates\n * that they are data points from different series, or if there is not\n * a label.\n */\n constructor(observationList: AnnotatedObservation[]) {\n super(observationList);\n\n let firstUnit;\n if (observationList.length > 0) {\n firstUnit = observationList[0].observation.unit;\n }\n // Ensure that the labels of the data are all the same.\n let differentUnits = false;\n\n for (const obs of observationList) {\n // Some observations may not have a normal range.\n if (obs.observation.normalRange) {\n this.normalRanges.set(\n obs.observation.timestamp, obs.observation.normalRange);\n }\n // Some observations may not have a normal range.\n if (obs.observation.unit && obs.observation.unit !== firstUnit) {\n differentUnits = true;\n }\n }\n if (!differentUnits && firstUnit) {\n this.unit = fixUnitAbbreviations(firstUnit);\n }\n\n this.anyQualitative = observationList.some(\n obs => (obs.observation.result !== null && !obs.observation.value));\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime} from 'luxon';\n\nimport {BCHMicrobioCode} from '../clinicalconcepts/bch-microbio-code';\nimport {LOINCCode} from '../clinicalconcepts/loinc-code';\nimport {ResourceCode} from '../clinicalconcepts/resource-code-group';\nimport {ResultClass} from '../fhir-resource-set';\nimport {fixUnitAbbreviations} from '../unit_utils';\nimport {ResultError} from './../result-error';\n\nimport {OBSERVATION_INTERPRETATION_VALUESET_URL, ObservationInterpretation} from './observation-interpretation-valueset';\n\n\n/**\n * These are the quantity attributes provided by FHIR. See\n * https://www.hl7.org/fhir/datatypes.html#quantity\n */\ninterface Quantity {\n value: number;\n comparator: string;\n unit: string;\n system: string;\n code: string;\n}\n\n/**\n * FHIR element for ObservationStatus, from the DSTU2 version of the\n * standard.\n * http://hl7.org/fhir/DSTU2/valueset-observation-status.html\n */\nexport enum ObservationStatus {\n Registered = 'Registered',\n Preliminary = 'Preliminary',\n Final = 'Final',\n Amended = 'Amended',\n Cancelled = 'Cancelled',\n EnteredInError = 'Enteredinerror',\n Unknown = 'Unknown'\n}\n\nconst statusToEnumMap = new Map([\n ['registered', ObservationStatus.Registered],\n ['preliminary', ObservationStatus.Preliminary],\n ['final', ObservationStatus.Final],\n ['amended', ObservationStatus.Amended],\n ['cancelled', ObservationStatus.Cancelled],\n ['entered-in-error', ObservationStatus.EnteredInError],\n ['unknown', ObservationStatus.Unknown],\n]);\n\n/**\n * This object represents a FHIR Observation. It does not contain all the\n * information in a standard Observation\n * (see https://www.hl7.org/fhir/observation.html#resource) but instead stores\n * only the information we're interested in seeing.\n *\n * In general, in terms of the MedTimeLine app, we represent an Observation\n * as a point on a line graph for a lab or a vital sign. Observations also hold\n * information about microbiology report results that show up in the\n * microbiology graph tooltips.\n */\nexport class Observation extends ResultClass {\n readonly codes: ResourceCode[] = [];\n timestamp: DateTime;\n readonly value: Quantity;\n // Populated if the Observation contains a qualitative result, such\n // as \"Yellow\", rather than a numerical value.\n readonly result: string;\n readonly normalRange: [number, number];\n readonly unit: string;\n readonly innerComponents: Observation[] = [];\n // The display string associated with the code for this Observation.\n readonly display: string;\n readonly interpretation: ObservationInterpretation;\n readonly status: ObservationStatus;\n\n // The number of decimal places stored in the value.\n readonly precision: number;\n\n /**\n * Makes an Observation out of a JSON object that represents a\n * a FHIR observation.\n * @param json A JSON object that represents a FHIR observation.\n * @param requestId The x-request-id of the request that acquired this\n * observation's data.\n */\n constructor(private json: any, requestId: string) {\n super(Observation.getLabel(json), requestId);\n\n this.timestamp = json.effectiveDateTime ?\n DateTime.fromISO(json.effectiveDateTime).toUTC() :\n json.issued ? DateTime.fromISO(json.issued).toUTC() : null;\n if (json.code) {\n if (json.code.coding) {\n if (json.code.coding[0].system === BCHMicrobioCode.CODING_STRING) {\n this.codes =\n json.code.coding\n .map((coding) => BCHMicrobioCode.fromCodeString(coding.code))\n // Filter out any codes that are not in our mapping.\n .filter((code) => !!code);\n this.display = json.code.coding[0].display;\n } else {\n this.codes =\n json.code.coding\n .map(\n // Map the codes to a boolean that is true only if the\n // encoding is a LOINC encoding, and the LOINC code appeas\n // in our LOINCCode list that we care about.\n (coding) => (!coding.system ||\n coding.system.indexOf(\n LOINCCode.CODING_STRING) !== -1) &&\n LOINCCode.fromCodeString(coding.code))\n // Filter out any codes that are not LOINC codes.\n .filter((code) => !!code);\n }\n }\n }\n\n if (json.interpretation) {\n if (json.interpretation.coding) {\n const coding = json.interpretation.coding[0];\n if (coding.system === OBSERVATION_INTERPRETATION_VALUESET_URL) {\n if (ObservationInterpretation.codeToObject.has(coding.code)) {\n this.interpretation =\n ObservationInterpretation.codeToObject.get(coding.code);\n } else {\n throw new ResultError(\n new Set([this.requestId]), 'Unsupported interpretation code.',\n coding);\n }\n }\n } else if (json.interpretation.text) {\n // BCH uses a non-standard coding system so we make interpretations on\n // the fly.\n this.interpretation = new ObservationInterpretation(\n json.interpretation.text, json.interpretation.text);\n }\n }\n\n if (json.component) {\n json.component.forEach(element => {\n const innerObs = new Observation(element, this.requestId);\n if (!innerObs.timestamp) {\n innerObs.timestamp = this.timestamp;\n }\n this.innerComponents.push(innerObs);\n });\n }\n\n if (!this.codes || this.codes.length === 0) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Observations have to have a LOINC code to be useful. ', json);\n }\n\n if (!this.label) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Observations have to have a label to be useful.', json);\n }\n\n // Check the observation label against the LOINC code label.\n if (this.label.toLowerCase() !== this.codes[0].label.toLowerCase()) {\n throw new ResultError(\n new Set([this.requestId]),\n `The label for this observation's LOINC code doesn't match ` +\n `the label in the data. Observation label: ${this.label}. ` +\n `LOINC label: ${this.codes[0].label}. `,\n json);\n }\n\n\n this.value = json.valueQuantity ? json.valueQuantity : null;\n if (this.value) {\n this.unit = fixUnitAbbreviations(this.value.unit);\n }\n\n // We must calculate precision before the value is stored as a number,\n // where precision is lost. If the value stored in the json has\n // a precision of 0 and is less than 1, then we change the precision to\n // 1 to display decimals and better UI.\n\n if (json.valueQuantity && json.valueQuantity.value) {\n const values = json.valueQuantity.value.toString().split('.');\n this.precision = values.length > 1 ? values[1].length : 0;\n if (values[0] === '0' && this.precision === 0) {\n this.precision = 1;\n }\n } else {\n // If the values are not present and are instead displayed as a value\n // of 0, the precision is set to 1 to prevent duplicated display of values\n this.precision = 1;\n }\n\n this.result =\n json.valueCodeableConcept ? json.valueCodeableConcept.text : null;\n if (this.value === null && this.result === null && !this.interpretation &&\n (this.innerComponents && this.innerComponents.length === 0)) {\n throw new ResultError(\n new Set([this.requestId]),\n 'An Observation must have a value, result, inner components, ' +\n 'or an interpretation to be useful.',\n json);\n }\n\n // The FHIR standard says that if there's only one range then it should be\n // what is \"normal\" for that measure. Otherwise they should be labeled.\n // We are going to err on the side of safety and not include a normal\n // range unless there's just the one, and it includes a high and low\n // field. https://www.hl7.org/fhir/DSTU2/observation.html#4.20.4.4\n if (json.referenceRange && json.referenceRange.length === 1) {\n if (json.referenceRange[0].low && json.referenceRange[0].high) {\n this.normalRange = [\n json.referenceRange[0].low.value, json.referenceRange[0].high.value\n ];\n }\n }\n\n this.status = statusToEnumMap.get(json.status);\n }\n\n private static getLabel(json: any) {\n let label;\n if (json.code) {\n label = json.code.text;\n if (json.code.coding) {\n if (json.code.coding[0].system === BCHMicrobioCode.CODING_STRING) {\n label = json.code.coding[0].display;\n }\n }\n }\n return label;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\nimport {ResultError} from '../result-error';\n/**\n * FHIR resource for a Specimen, from the DSTU2 standard.\n * https://www.hl7.org/fhir/DSTU2/specimen.html\n */\nexport class Specimen {\n /** If this is a contained resource, then it will have an ID string. */\n readonly id: string;\n\n /** Kind of material that forms the specimen */\n readonly type: string;\n\n /** Where the specimen was collected */\n readonly bodySite: string;\n\n /**\n * When the specimen was collected. The specimen will have one or the other\n * of these defined, but not both.\n */\n readonly collectedDateTime: DateTime;\n readonly collectedPeriod: Interval;\n\n readonly requestId: string;\n\n constructor(json: any, requestId: string) {\n this.requestId = requestId;\n\n if (json.id) {\n this.id = json.id;\n }\n\n if (!json.type) {\n throw new ResultError(\n new Set([this.requestId]),\n 'A specimen must have a type to be useful.', json);\n }\n\n this.type = json.type.text;\n\n if (!json.collection) {\n throw new ResultError(\n new Set([this.requestId]),\n 'A specimen must have collection information to be useful.', json);\n }\n if (json.collection.collectedPeriod && json.collection.collectedDateTime) {\n throw new ResultError(\n new Set([this.requestId]),\n 'Only collectedPeriod or collectionDateTime should be defined.' +\n json);\n }\n\n if (json.collection.collectedPeriod) {\n const collectedPeriod = json.collection.collectedPeriod;\n // If only the start time is present, put it into collectedDateTime.\n if (collectedPeriod.start && !collectedPeriod.end) {\n this.collectedDateTime = DateTime.fromISO(collectedPeriod.start);\n } else {\n this.collectedPeriod = Interval.fromDateTimes(\n DateTime.fromISO(collectedPeriod.start),\n DateTime.fromISO(collectedPeriod.end));\n }\n }\n\n if (json.collection.collectedDateTime) {\n this.collectedDateTime =\n DateTime.fromISO(json.collection.collectedDateTime);\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';\nimport {Inject, Injectable} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {DateTime, Interval} from 'luxon';\n\nimport {APP_TIMESPAN, EARLIEST_ENCOUNTER_START_DATE, FhirResourceType} from '../constants';\n\nimport {BCHMicrobioCodeGroup} from './clinicalconcepts/bch-microbio-code';\nimport {LOINCCode} from './clinicalconcepts/loinc-code';\nimport {documentReferenceLoinc} from './clinicalconcepts/resource-code-manager';\nimport {RxNormCode} from './clinicalconcepts/rx-norm';\nimport {DebuggerService} from './debugger.service';\nimport {DiagnosticReport} from './fhir-data-classes/diagnostic-report';\nimport {Encounter} from './fhir-data-classes/encounter';\nimport {MedicationAdministration} from './fhir-data-classes/medication-administration';\nimport {MedicationOrder} from './fhir-data-classes/medication-order';\nimport {Observation, ObservationStatus} from './fhir-data-classes/observation';\nimport {ResultClass} from './fhir-resource-set';\nimport {FhirService} from './fhir.service';\nimport * as FhirConfig from './fhir_config';\nimport {SMART_ON_FHIR_CLIENT} from './smart-on-fhir-client';\n\nconst GREATER_OR_EQUAL = 'ge';\nconst LESS_OR_EQUAL = 'le';\n\n// The Cerner implementation has a maximum result return of 100 for\n// observations.\nconst CERNER_MAX_OBS_RESULTS_RETURNED = 100;\n\n@Injectable()\nexport class FhirHttpService extends FhirService {\n readonly smartApiPromise: Promise;\n constructor(\n private debugService: DebuggerService,\n @Inject(SMART_ON_FHIR_CLIENT) smartOnFhirClient: any,\n private sanitizer: DomSanitizer, private http: HttpClient) {\n super();\n // Create a promise which resolves to the smart API when the smart API is\n // ready. This allows clients of this service to call service methods\n // which depend on the API, regardless of whether the API is ready or not.\n this.smartApiPromise = new Promise(\n (resolve, reject) => smartOnFhirClient.oauth2.ready(\n smart => resolve(smart), err => reject(err)));\n }\n\n /**\n * Gets the next page of search results from the smart API. This function\n * assumes that the same smartApi was used to call the original search.\n *\n * @param smartApi The resolved smartOnFhirClient\n * @param response The response from the previous page of search results\n * @param results The list of all formatted results processed in previous page\n * responses\n * @param createFunction A function to create a result object from the\n * response\n */\n getNextSearchResultsPage(\n smartApi, response, results,\n createFunction: (json: any, requestId: string) => T): Promise {\n const requestId = response.headers('x-request-id');\n const responseData = response.data.entry || [];\n\n results = results.concat(\n responseData.map(result => createFunction(result.resource, requestId)));\n\n // if there are anymore pages, get the next set of results.\n if (response.data.link.some((link) => link.relation === 'next')) {\n return smartApi.patient.api.nextPage({bundle: response.data})\n .then(nextResponse => {\n return this.getNextSearchResultsPage(\n smartApi, nextResponse, results, createFunction);\n });\n }\n return Promise.resolve(results);\n }\n\n /**\n * Gets all pages of search results for the given query params. Formats\n * the results using the given createFunction.\n *\n * @param smartApi The resolved smartOnFhirClient\n * @param queryParams the params to pass to the search function\n * @param createFunction A function to create result objects from\n * the response data.\n */\n fetchAll(\n smartApi, queryParams,\n createFunction: ((json: any, requestId: string) => T)): Promise {\n const results = [];\n return smartApi.patient.api.search(queryParams)\n .then(\n response => {\n return this\n .getNextSearchResultsPage(\n smartApi, response, results, createFunction)\n .then(results => {\n return results;\n });\n },\n rejection => {\n this.debugService.logError(rejection);\n throw rejection;\n });\n }\n\n private getObservationsSearchParams(code: LOINCCode, dateRange: Interval) {\n // Cerner says that asking for a limited count of resources can slow down\n // queries, so we don't restrict a count limit here.\n // https://groups.google.com/d/msg/cerner-fhir-developers/LMTgGypmLDg/7f6hDoe2BgAJ\n return {\n type: FhirResourceType.Observation,\n query: {\n code: LOINCCode.CODING_STRING + '|' + code.codeString,\n date: {\n $and: [\n GREATER_OR_EQUAL + dateRange.start.toISODate(),\n LESS_OR_EQUAL + dateRange.end.toISODate()\n ]\n },\n }\n };\n }\n\n /**\n * Gets observations from a specified date range with a specific LOINC code.\n * @param code The LOINC code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n */\n getObservationsWithCode(code: LOINCCode, dateRange: Interval):\n Promise {\n const queryParams = this.getObservationsSearchParams(code, dateRange);\n return this.smartApiPromise.then(\n smartApi =>\n this.fetchAll(\n smartApi, queryParams,\n (json, requestId) => new Observation(json, requestId))\n .then(\n (results: Observation[]) => results.filter(\n (result: Observation) => result.status !==\n ObservationStatus.EnteredInError)));\n }\n\n /**\n * Checks if there are any observations with the given LOINC Code within the\n * given date range.\n *\n * Note: Only fetches single page of results from FHIR server to enhance\n * performance.\n *\n * @param code LOINC code to check if there are any observations for\n * @param dateRange the time interval the observations should fall between\n */\n observationsPresentWithCode(code: LOINCCode, dateRange: Interval):\n Promise {\n const queryParams = this.getObservationsSearchParams(code, dateRange);\n return this.smartApiPromise.then(\n smartApi => smartApi.patient.api.search(queryParams)\n .then(response => !!response.data.entry));\n }\n\n /**\n * Formats query parameters for searching for Medication Administrations.\n * @param dateRange Date range to search within\n */\n private getMedicationAdministrationSearchParams(dateRange: Interval) {\n return {\n type: FhirResourceType.MedicationAdministration,\n query: {\n effectivetime: {\n $and: [\n GREATER_OR_EQUAL + dateRange.start.toISODate(),\n LESS_OR_EQUAL + dateRange.end.toISODate()\n ]\n }\n }\n };\n }\n\n /**\n * Gets medication data from a specified date range with a specific Rx code\n * @param code The RxNormCode codes for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount If provided, the maximum number of observations to\n * query for.\n */\n getMedicationAdministrationsWithCode(\n code: RxNormCode, dateRange: Interval,\n limitCount?: number): Promise {\n const queryParams = this.getMedicationAdministrationSearchParams(dateRange);\n\n if (limitCount) {\n queryParams.query['_count'] = limitCount;\n }\n\n return this.smartApiPromise.then(\n smartApi =>\n this.fetchAll(\n smartApi, queryParams,\n (json, requestId) => {\n if (ResultClass.extractMedicationEncoding(json) ===\n code) {\n return new MedicationAdministration(json, requestId);\n }\n })\n .then(\n (results: MedicationAdministration[]) =>\n results.filter((result) => !!result)));\n }\n\n /**\n * Determines whether a medication with the given RxNormCode exists.\n *\n * Checks a single response page and only calls the next page if no\n * medications with the given code exist. Cerner's implementation of FHIR\n * does not support searching by RxNormCode, so we need to get all of the\n * medications and filter the response.\n *\n * @param smartApi The resolved smartOnFhirClient which called the original\n * \"search\"\n * @param response The response of the previous page\n * @param code The RxNormCode to search for\n */\n private checkMedicationsPresentNextPage(smartApi, response, code: RxNormCode):\n Promise {\n const results = response.data.entry || [];\n const resultsWithCode = results.filter(\n result =>\n code === ResultClass.extractMedicationEncoding(result.resource));\n\n if (resultsWithCode.length > 0) {\n return Promise.resolve(true);\n } else {\n if (response.data.link.some((link) => link.relation === 'next')) {\n return smartApi.patient.api.nextPage({bundle: response.data})\n .then(nextResponse => {\n return this.checkMedicationsPresentNextPage(\n smartApi, nextResponse, code);\n });\n } else {\n return Promise.resolve(false);\n }\n }\n }\n\n /**\n * Determines whether their is a medication present with the given code\n * during the given date range\n * @param code The RxNormCode to get medications for\n * @param dateRange The date range to get medications for\n */\n medicationsPresentWithCode(code: RxNormCode, dateRange: Interval):\n Promise {\n const queryParams = this.getMedicationAdministrationSearchParams(dateRange);\n return this.smartApiPromise.then(smartApi => {\n return smartApi.patient.api.search(queryParams)\n .then(\n response => this.checkMedicationsPresentNextPage(\n smartApi, response, code));\n });\n }\n\n /**\n * Gets order for specified external id.\n * @param id The id to pull the order from.\n */\n getMedicationOrderWithId(id: string): Promise {\n return this.smartApiPromise.then(\n smartApi =>\n smartApi.patient.api\n .read({type: FhirResourceType.MedicationOrder, 'id': id})\n .then(\n (result: any) => {\n const requestId = result.headers('x-request-id');\n return new MedicationOrder(result.data, requestId);\n },\n // Do not return any MedicationOrders for\n // this code if one of the MedicationOrder\n // constructions throws an error.\n rejection => {\n this.debugService.logError(rejection);\n throw rejection;\n }));\n }\n\n /**\n * Gets administrations for specified order id.\n * @param id The id to pull the order from.\n */\n getMedicationAdministrationsWithOrder(id: string, code: RxNormCode):\n Promise {\n const queryParams = {\n type: FhirResourceType.MedicationAdministration,\n };\n return this.smartApiPromise.then(\n smartApi =>\n this.fetchAll(\n smartApi, queryParams,\n (json, requestId) => {\n if (ResultClass.extractMedicationEncoding(json) ===\n code) {\n return new MedicationAdministration(json, requestId);\n }\n })\n .then(\n (results: MedicationAdministration[]) =>\n results.filter((result) => !!result)\n .filter(\n (result: MedicationAdministration) =>\n result.medicationOrderId === id)));\n }\n\n /**\n * Gets the encounters for the patient for any encounter that falls in the\n * given date range.\n * @param dateRange Return all encounters that covered any time in this\n * date range.\n */\n getEncountersForPatient(dateRange: Interval): Promise {\n const queryParams = {\n type: FhirResourceType.Encounter,\n };\n\n if (!dateRange) {\n dateRange = APP_TIMESPAN;\n }\n // The Cerner implementation of the Encounter search does not offer any\n // filtering by date at this point, so we grab all the encounters\n // then filter them down to those which intersect with the date range\n // we query, and those that have a start date no earlier than a year prior\n // to now.\n return this.smartApiPromise.then(\n smartApi =>\n this.fetchAll(\n smartApi, queryParams,\n (json, requestId) => new Encounter(json, requestId))\n .then(\n (results: Encounter[]) =>\n results\n .filter(\n (result: Encounter) =>\n dateRange.intersection(result.period) !==\n null)\n .filter(\n (result: Encounter) => result.period.start >=\n EARLIEST_ENCOUNTER_START_DATE)));\n }\n\n /**\n * Saves the current image of the graphs rendered as a DocumentReference\n * (static save).\n * @param html The inner HTML to keep in the Document.\n * @param date The date the note was written on.\n */\n saveStaticNote(image: HTMLCanvasElement, date: string): Promise {\n return this.smartApiPromise.then(smartApi => {\n const postBody = {\n resourceType: FhirResourceType.DocumentReference,\n subject: {\n reference: [FhirResourceType.Patient, smartApi.patient.id].join('/')\n },\n type: {\n coding: [{\n system: LOINCCode.CODING_STRING, // must be loinc\n code: documentReferenceLoinc.codeString, // Summary Note\n }],\n },\n indexed: DateTime.utc().toISO(),\n status:\n 'current', // Required; only supported option is 'current'\n // https://fhir.cerner.com/millennium/dstu2/infrastructure/document-reference/#body-fields\n content: [{\n attachment: {\n contentType: 'application/xhtml+xml;charset=utf-8',\n data: btoa('')\n }\n }],\n context: {\n encounter: {\n reference: [\n FhirResourceType.Encounter, smartApi.tokenResponse.encounter\n ].join('/')\n }\n }\n };\n return smartApi.patient.api.create({resource: postBody})\n .then(\n resolve => {\n return true;\n },\n reject => {\n return false;\n });\n });\n }\n\n /**\n * Gets the DiagnosticReports for the patient for any report that falls in\n * the given date range.\n * @param codeGroup The CodeGroup to retrieve DiagnosticReports for.\n * @param dateRange Return all DiagnosticReports that covered any time in this\n * date range.\n */\n getDiagnosticReports(codeGroup: BCHMicrobioCodeGroup, dateRange: Interval):\n Promise {\n if (!FhirConfig.microbiology) {\n console.warn(\n 'No microbiology parameters available in the configuration.');\n return Promise.resolve([]);\n }\n return this.smartApiPromise.then(\n smartApi => {\n // YYYY-MM-DD format for dates\n let callParams = new HttpParams();\n callParams = callParams.append('patient', smartApi.patient.id);\n callParams = callParams.append('category', 'microbiology'),\n callParams = callParams.append(\n 'item-date', 'ge' + dateRange.start.toFormat('yyyy-MM-dd'));\n callParams = callParams.append(\n 'item-date', 'le' + dateRange.end.toFormat('yyyy-MM-dd'));\n callParams = callParams.append('_format', 'json');\n\n const authString = btoa(\n FhirConfig.microbiology.username + ':' +\n FhirConfig.microbiology.password);\n const httpHeaders = new HttpHeaders({\n 'Content-Type': 'application/json',\n 'Accept': 'application/json',\n 'Authorization': 'Basic ' + authString,\n });\n\n return this.http\n .get(\n [\n FhirConfig.microbiology.url,\n FhirResourceType.DiagnosticReport\n ].join('/'),\n {headers: httpHeaders, params: callParams})\n .toPromise()\n .then((res: any) => {\n return DiagnosticReport.parseAndFilterMicrobioData(\n res, codeGroup);\n });\n },\n rejection => {\n this.debugService.logError(rejection);\n throw rejection;\n });\n }\n}\n","module.exports = \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2ZoaXItbGF1bmNoL2ZoaXItbGF1bmNoLmNvbXBvbmVudC5jc3MifQ== */\"","module.exports = \"Launching authentication...\\n
\\n Authentication Information
\\n Base URI: {{this.baseURL}}
\\n Redirect URI : {{this.redirectURL}}
\\n Scopes: {{this.scope}};
\\n URL parameters: {{this.parameters}}
\\n \\n
\\nError: This app is not configured for this EHR.\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport 'fhirclient';\n\nimport {Component, OnInit} from '@angular/core';\nimport {ActivatedRoute} from '@angular/router';\nimport {Router} from '@angular/router';\n\nimport {environment} from '../../environments/environment';\n\nimport * as FhirConfig from './../fhir_config';\n\n/* Type definition for SMART on FHIR client (from assets/fhir-client.min.js) */\ndeclare var FHIR: any;\n\n@Component({\n selector: 'app-fhir-launch',\n templateUrl: './fhir-launch.component.html',\n styleUrls: ['./fhir-launch.component.css']\n})\nexport class FhirLaunchComponent implements OnInit {\n error = false;\n\n scope: string = [\n 'launch', 'patient/Observation.read', 'patient/Patient.read',\n 'patient/MedicationOrder.read', 'patient/MedicationAdministration.read',\n 'patient/DocumentReference.read', 'patient/DocumentReference.write',\n 'patient/Encounter.read'\n ].join(' ');\n\n // We hold these variables in-class for authentication debugging.\n clientId: string;\n baseURL: string;\n redirectURL: string;\n useDebugger: boolean;\n parameters = new Array();\n\n constructor(private router: Router, private route: ActivatedRoute) {}\n\n ngOnInit() {\n if (environment.useMockServer) {\n this.router.navigate(['setup']);\n } else {\n this.useDebugger = environment.useDebugger;\n\n this.route.queryParams.subscribe(params => {\n const state = params['state'];\n const code = params['code'];\n if (state && code) {\n // Navigate to the setup page, passing the code & state parameters\n // along with the URL.\n this.router.navigateByUrl('/setup?code=' + code + '&state=' + state);\n } else {\n if (this.useDebugger) {\n this.clientId = FhirConfig.credentials.client_id;\n this.baseURL = FhirConfig.url.baseURL;\n this.redirectURL = FhirConfig.url.redirectURL;\n this.route.queryParams.subscribe(pms => {\n this.parameters.push(JSON.stringify(pms));\n });\n return;\n }\n\n this.beginAuthenticationFlow();\n }\n });\n }\n }\n\n beginAuthenticationFlow() {\n const clientId = FhirConfig.credentials.client_id;\n if (!clientId) {\n this.error = true;\n } else {\n FHIR.oauth2.authorize({\n 'client_id': clientId,\n 'scope': this.scope,\n 'redirect_uri': FhirConfig.url.redirectURL\n });\n }\n }\n}\n","// Copyright 2019 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\nimport {DateTime} from 'luxon';\n\nimport {RXNORM_CODES, RxNormCode} from './clinicalconcepts/rx-norm';\nimport {ResultError} from './result-error';\n\n// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\nexport class TimestampedObject {\n constructor(readonly timestamp: DateTime) {}\n}\n\nexport class ResultClassWithTimestamp extends TimestampedObject {\n constructor(\n readonly label: string, readonly requestId: string,\n readonly timestamp: DateTime) {\n super(timestamp);\n }\n}\n\n/**\n * A class that has label and requestId attributes.\n *\n * TODO: Figure out how to combine with ResultClassWithTimestamp.\n */\nexport class ResultClass {\n constructor(readonly label: string, readonly requestId: string) {}\n\n /**\n * Parses the passed-in JSON and gets out a RxNormCode.\n *\n * This function prefers to directly get the RxNorm code from the resource's\n * encoding. If it can't get that, it will get the prescription's label,\n * then try to map it back to a RxNorm code. If it can't find a suitable\n * RxNorm code, it will pass back an undefined object.\n */\n static extractMedicationEncoding(json: any): RxNormCode {\n let rxNormCode: RxNormCode;\n if (json.medicationCodeableConcept) {\n if (json.medicationCodeableConcept.coding) {\n rxNormCode =\n (json.medicationCodeableConcept.coding\n .map(\n // Map the codes to a boolean that is true only if the\n // encoding is an RxNorm encoding, and the RxNorm code\n // appears in our RxNormCode list that we care about.\n (coding) => (!coding.system ||\n coding.system.indexOf(\n RxNormCode.CODING_STRING) !== -1) &&\n RxNormCode.fromCodeString(coding.code))\n // Filter out any codes that are not RxNorm codes.\n .filter((code) => !!code))[0];\n } else if (json.medicationCodeableConcept.text) {\n // MedicationAdministrations do not come out of the BCH system with a\n // RxNorm code on at this point, so if we don't get a RxNorm code,\n // as a stopgap we reverse lookup based on the string name.\n const rxNormString = json.medicationCodeableConcept.text;\n const codesWithName = RXNORM_CODES.filter(\n x => x.label.toLowerCase() === rxNormString.toLowerCase());\n rxNormCode = codesWithName.length === 1 ? codesWithName[0] : undefined;\n }\n }\n return rxNormCode;\n }\n}\n\n/**\n * A set of FHIR resources. All resources that are a part of this set must\n * have the same label.\n */\nexport class FhirResourceSet {\n /**\n * The list of resources that belong together.\n */\n readonly resourceList: T[];\n readonly requestIds: Set;\n\n /*\n * The label for this set of data. All data in this set\n * must have the same label.\n */\n label: string;\n\n /**\n * Constructor for FhirResourceSet.\n * @param resourceList The list of resources belonging together.\n * @throws Error if the resources have different labels, or if there is not\n * a label.\n */\n constructor(resourceList: T[]) {\n this.requestIds = new Set(resourceList.map(resource => resource.requestId));\n\n if (!resourceList) {\n throw new ResultError(this.requestIds, 'Resource list is undefined.');\n }\n\n if (resourceList.length > 0) {\n const firstLabel = resourceList[0].label;\n if (!firstLabel) {\n throw new ResultError(\n this.requestIds, 'The first resource does not have a label.');\n }\n\n const allLabels = new Set(resourceList.map(rs => rs.label.toLowerCase()));\n if (allLabels.size !== 1) {\n throw new ResultError(\n this.requestIds,\n `The resource list in this set has mixed labels: ${\n Array.from(allLabels.values())}`);\n }\n this.label = firstLabel;\n }\n\n this.resourceList = resourceList;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Injectable} from '@angular/core';\nimport {Interval} from 'luxon';\nimport {of} from 'rxjs';\n\nimport {BCHMicrobioCodeGroup} from './clinicalconcepts/bch-microbio-code';\nimport {LOINCCode, LOINCCodeGroup} from './clinicalconcepts/loinc-code';\nimport {RxNormCode} from './clinicalconcepts/rx-norm';\nimport {RxNormCodeGroup} from './clinicalconcepts/rx-norm-group';\nimport {DiagnosticReport} from './fhir-data-classes/diagnostic-report';\nimport {Encounter} from './fhir-data-classes/encounter';\nimport {MedicationAdministration} from './fhir-data-classes/medication-administration';\nimport {MedicationOrder} from './fhir-data-classes/medication-order';\nimport {Observation} from './fhir-data-classes/observation';\n\n@Injectable()\nexport abstract class FhirService {\n /**\n * Returns whether there are any observations with this code in the given\n * time range.\n * @param code The LOINC code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n */\n abstract observationsPresentWithCode(code: LOINCCode, dateRange: Interval):\n Promise;\n\n /**\n * Returns whether there are any observations with this code in the given\n * time range.\n * @param code The BCHMicrobio code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n */\n diagnosticReportsPresentWithCodes(\n codeGroup: BCHMicrobioCodeGroup, dateRange: Interval): Promise {\n // Just ask for one result to reduce the call time.\n return this.getDiagnosticReports(codeGroup, dateRange, 1)\n .then(reports => reports.length > 0, rejection => {\n // If any DiagnosticReports for this code results in an error, do not\n // show any DiagnosticReports at all.\n throw rejection;\n });\n }\n\n /**\n * Gets observations from a specified date range with a specific LOINC code.\n * @param code The LOINC code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount If provided, the maximum number of observations to\n * query for.\n */\n abstract getObservationsWithCode(\n code: LOINCCode,\n dateRange: Interval,\n ): Promise;\n\n /**\n * Gets observations from a specified date range with a specific code group.\n * @param codeGroup The LOINCCodeGroup code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @returns The observations if there's a valid code group or date range.\n */\n getObservationsForCodeGroup(codeGroup: LOINCCodeGroup, dateRange: Interval):\n Promise {\n if (!codeGroup || !dateRange) {\n return of([]).toPromise();\n }\n const observationPromises = new Array>();\n for (const c of codeGroup.resourceCodes) {\n if (c instanceof LOINCCode) {\n observationPromises.push(this.getObservationsWithCode(c, dateRange));\n }\n }\n return Promise.all(observationPromises);\n }\n\n /**\n * Returns whether there are any observations with this code in the given\n * time range.\n * @param code The RxNorm code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n */\n abstract medicationsPresentWithCode(code: RxNormCode, dateRange: Interval):\n Promise;\n\n /**\n * Gets medication data from a specified date range with a specific Rx code\n * group.\n * @param codeGroup The RxNormCode code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount If provided, the maximum number of observations to\n * query for.\n */\n abstract getMedicationAdministrationsWithCode(\n code: RxNormCode, dateRange: Interval,\n limitCount?: number): Promise;\n\n /**\n * Gets medication data from a specified date range with specific Rx codes,\n * since multiple medications are displayed on a single chart.\n * @param codes The RxNormCode codes for which to get observations.\n * @param dateRanges The time interval observations should fall between.\n */\n getMedicationAdministrationsWithCodes(\n codes: RxNormCodeGroup,\n dateRange: Interval): Promise {\n if (!codes || !dateRange) {\n return of([]).toPromise();\n }\n const medicationPromises = new Array>();\n for (const code of codes.resourceCodes) {\n medicationPromises.push(this.getMedicationAdministrationsWithCode(\n code as RxNormCode, dateRange));\n }\n // This will be rejected if any Promise is rejected.\n return Promise.all(medicationPromises)\n .then(\n resolvedMedications =>\n // flatten the results into single medication administrations\n // list\n [].concat(...resolvedMedications));\n }\n\n /**\n * Gets the order for specified order id.\n * @param id The id to pull the order from.\n */\n abstract getMedicationOrderWithId(id: string): Promise;\n\n /**\n * Gets administrations for specified order id.\n * @param id The id to pull the order from.\n */\n abstract getMedicationAdministrationsWithOrder(id: string, code: RxNormCode):\n Promise;\n\n /**\n * Gets the encounters for the patient for any encounter that falls in the\n * given date range.\n * @param dateRange Return all encounters that covered any time in this\n * date range.\n */\n abstract getEncountersForPatient(dateRange: Interval): Promise;\n\n /**\n * Saves the current image of the graphs rendered as a DocumentReference\n * (static save).\n * @param image The image to save in the Document.\n * @param date The date the note was written on.\n */\n abstract saveStaticNote(image: HTMLCanvasElement, date: string):\n Promise;\n\n /**\n * Gets the DiagnosticReports for the patient for any report that falls in\n * the given date range.\n * @param codeGroup The CodeGroup to retrieve DiagnosticReports for.\n * @param dateRange Return all DiagnosticReports that covered any time in this\n * date range.\n */\n abstract getDiagnosticReports(\n codeGroup: BCHMicrobioCodeGroup, dateRange: Interval,\n limitCount?: number): Promise;\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime} from 'luxon';\nimport {CustomizableGraphAnnotation} from '../graphtypes/customizable-graph/customizable-graph-annotation';\n\nimport {GraphData} from './graphdata';\nimport {LabeledSeries} from './labeled-series';\n\n/**\n * CustomizableData holds a time-based series to which a user can add more\n * points.\n */\nexport class CustomizableData extends GraphData {\n /** The display bounds of the y-axis. */\n readonly yAxisDisplayBounds: [number, number];\n\n private constructor(\n series: LabeledSeries,\n /**\n * The annotations for this customizable graph. If populated, holds a\n * map from a number representation of a Date to\n * CustomizableGraphAnnotation for the corresponding point.\n */\n readonly annotations: Map,\n regions?: any[]) {\n super(\n [series], undefined, // tooltip map\n undefined, // tooltip key function\n regions);\n this.annotations = annotations;\n this.yAxisDisplayBounds = [0, 10];\n }\n\n static defaultEmptySeries() {\n return new CustomizableData(\n LabeledSeries.emptySeries(),\n new Map());\n }\n\n /**\n * Adds a point to the series in this CustomizableData object.\n * @param annotation: The annotation to add in to the graph.\n */\n addPointToSeries(annotation: CustomizableGraphAnnotation) {\n // This method assumes there is only 1 series.\n this.series[0].coordinates.push([annotation.timestamp, 0]);\n this.annotations.set(annotation.timestamp.toMillis(), annotation);\n }\n\n /**\n * Removes a point from the series in this CustomizableData object, as well as\n * the corresponding annotation.\n * @param date The date for this point to remove.\n */\n removePointFromSeries(date: DateTime) {\n const index = this.series[0].coordinates.findIndex(\n c => c[0].toMillis() === date.toMillis());\n this.series[0].coordinates.splice(index, 1);\n this.annotations.delete(date.toMillis());\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\n\nimport {LabeledSeries} from './labeled-series';\n\n/**\n * The base class for holding data pertaining to one graph.\n */\nexport class GraphData {\n // The number of decimal places to show for any value associated with this\n // GraphData. The default is 0, to minimize errors caused by unnecessary\n // trailing zeros.\n precision = 0;\n\n constructor(\n /** A list of the series to be displayed on the graph. */\n readonly series: LabeledSeries[] = [],\n\n /**\n * A map to provide tooltips.\n * This is a bit complicated. c3's API lets you specify a function call\n * that will provide the HTML content for any given point's tooltip.\n * As a parameter, it passes in one or more data points:\n * https://c3js.org/reference.html#tooltip-contents\n * so when the tooltip is rendered, all you have is the plotted\n * information. As far as I can tell, that data structure is undocumented.\n * Upon inspection, the data point includes which series it belongs to,\n * the x value, and the y value, so if you want to render a custom\n * tooltip, you have to be able to derive all the information you need\n * from those values.\n * tooltipMap, alongside tooltipKeyFn, helps with this process.\n * If you call tooltipKeyFn on the data object passed into the c3 contents\n * function, it should yield the key into tooltipMap that will let you\n * look up the appropriate tooltip for that data point. If tooltipKeyFn\n * is unset, then we fall back to the default lookup, which is by x-value.\n */\n readonly tooltipMap?: Map,\n /**\n * See documentation on tooltipMap for more detail. tooltipKeyFn\n * takes in a graph data point and returns the key into tooltipMap that\n * provides the tooltip for that data point.\n */\n readonly tooltipKeyFn?: (graphData: any) => string,\n /**\n * A list of x-axis regions to display on the graph.\n */\n readonly xRegions = new Array<[DateTime, DateTime]>()) {}\n\n /*\n * Returns whether or not there are any data points in the series that fall\n * inside the date range provided.\n * @param series The LabeledSeries to find data points in the date range.\n * @param dateRange The date range in which to see if there are any data\n * points.\n */\n dataPointsInRange(dateRange: Interval): boolean {\n const entireRange = Interval.fromDateTimes(\n dateRange.start.toLocal().startOf('day'),\n dateRange.end.toLocal().endOf('day'));\n for (const s of this.series) {\n if (s.hasPointInRange(entireRange)) {\n return true;\n }\n }\n return false;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DateTime, Interval} from 'luxon';\n\n// tslint:disable-next-line:max-line-length\nimport {DisplayGrouping, negFinalMB, negOtherMB, negPrelimMB, posFinalMB, posOtherNB, posPrelimMB} from '../clinicalconcepts/display-grouping';\nimport {DiagnosticReport, DiagnosticReportStatus} from '../fhir-data-classes/diagnostic-report';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {MedicationAdministration} from '../fhir-data-classes/medication-administration';\nimport {CHECK_RESULT_CODE, NORMAL} from '../fhir-data-classes/observation-interpretation-valueset';\nimport {LegendInfo} from '../graphtypes/legend-info';\n\nimport {MedicationOrder, MedicationOrderSet} from './../fhir-data-classes/medication-order';\nimport {ObservationSet} from './../fhir-data-classes/observation-set';\n\n/**\n * Timeseries data, represented as a list of tuples,\n * with metadata including a human-readable label, a unit, and a typical range.\n * Used for most charts to display a changing value over time. Multiple\n * LabeledSeries may appear on the same graph.\n */\nexport class LabeledSeries {\n /**\n * The y units for this series.\n */\n unit: string;\n\n /**\n * The DisplayGrouping this LabeledSeries corresponds to.\n */\n concept: DisplayGrouping;\n\n /**\n * A map of DateTimes to corresponding tuples representing the low and high\n * bounds of what should be considered \"normal\" along the y-axis.\n */\n normalRanges = new Map();\n\n /**\n * This is the desired display range for the y-axis for this series. We\n * calculate it as as:\n * [minimum(yNormalBounds, yValues), maximum(yNormalBounds, yValues)]\n */\n readonly yDisplayBounds: [number, number];\n\n constructor(\n /** The descriptive label of the data series. */\n readonly label: string,\n /**\n * The coordinate set for the series. The y-coordinates may be strings\n * or numbers, depending on whether this is a categorical or numerical\n * graph.\n */\n readonly coordinates: Array<[DateTime, string|number, string?]>,\n /** The y-axis unit for this series. */\n unit?: string,\n /**\n * Holds information about how this series should be displayed.\n */\n readonly legendInfo?: LegendInfo,\n /**\n * The x-coordinate values in the labeled series that should be marked as\n * abnormal because of their interpretation results.\n */\n readonly abnormalCoordinates = new Set(),\n /**\n * A map of DateTimes to corresponding tuples representing the low and\n * high bounds of what should be considered \"normal\" along the y-axis.\n */\n normalRanges?: Map,\n /**\n * The DisplayGrouping associated with this LabeledSeries.\n */\n concept?: DisplayGrouping) {\n // Sort the coordinates by x-value.\n this.coordinates = coordinates.sort((a, b) => {\n return a[0].toMillis() - b[0].toMillis();\n });\n this.unit = unit;\n\n // If a specific legend wasn't passed through then we generate one for the\n // series.\n this.legendInfo = legendInfo || new LegendInfo(label);\n\n this.concept = concept;\n this.normalRanges = normalRanges;\n\n /**\n * Calculate the y axis display bounds by finding the outer boundaries of\n * the data and the normal range.\n */\n\n const yValues = this.coordinates.map(c => c[1]).filter(x => x !== null);\n\n if (yValues.map(val => typeof val === 'number').some(x => x === false)) {\n return;\n }\n this.yDisplayBounds =\n [Math.min.apply(Math, yValues), Math.max.apply(Math, yValues)];\n }\n\n /**\n * Generates an empty LabeledSeries.\n */\n static emptySeries() {\n return new LabeledSeries('', []);\n }\n\n\n /**\n * Generates a LabeledSeries from the given ObservationSet.\n * @param observationSet The ObservationSet to chart.\n * @param encounters A list of Encounters to use while determining line breaks\n * in series.\n */\n static fromObservationSet(\n observationSet: ObservationSet, encounters: Encounter[]): LabeledSeries {\n let coordinates: Array<[DateTime, number]> = [];\n const observations = observationSet.resourceList;\n const abnormal = new Set();\n for (const obs of observations) {\n coordinates.push([\n obs.observation.timestamp,\n obs.observation.value ? obs.observation.value.value : null\n ]);\n\n const outsideNormalRange = obs.observation.normalRange &&\n (obs.observation.value.value < obs.observation.normalRange[0] ||\n obs.observation.value.value > obs.observation.normalRange[1]);\n\n if ((obs.observation.interpretation &&\n obs.observation.interpretation.code !== NORMAL) ||\n outsideNormalRange) {\n abnormal.add(obs.observation.timestamp.toISO());\n }\n }\n\n coordinates = this.addEncounterEndpoints(coordinates, encounters);\n return new LabeledSeries(\n observationSet.label, coordinates, observationSet.unit,\n undefined, // legendInfo,\n abnormal, observationSet.normalRanges);\n }\n\n /**\n * Generates a LabeledSeries from the given list of discrete resulted-\n * ObservationSets.\n * For Observations with discrete values, such as \"yellow\"\n * for the color of urine, we group all ObservationSets into one\n * LabeledSeries, at a specific yValue.\n * @param observationSets The discrete ObservationSets to chart.\n * @param yValue The numerical y-value to map to this ObservationSet with\n * discrete results.\n * @param label The label for this LabeledSeries.\n * @param encounters A list of Encounters to use while determining line breaks\n * in series.\n */\n static fromObservationSetsDiscrete(\n observationSets: ObservationSet[], yValue: number, label,\n encounters: Encounter[]): LabeledSeries {\n let coordinates: Array<[DateTime, number | string]> = [];\n const abnormal = new Set();\n for (const obsSet of observationSets) {\n const observations = obsSet.resourceList;\n for (const obs of observations) {\n coordinates.push([obs.observation.timestamp, yValue]);\n\n if (obs.observation.interpretation &&\n obs.observation.interpretation.code !== NORMAL) {\n abnormal.add(obs.observation.timestamp.toISO());\n }\n const outsideNormalRange = obs.observation.normalRange &&\n (obs.observation.value.value < obs.observation.normalRange[0] ||\n obs.observation.value.value > obs.observation.normalRange[1]);\n\n if (obs.observation.value && obs.observation.value.value &&\n outsideNormalRange) {\n abnormal.add(obs.observation.timestamp.toISO());\n }\n }\n }\n coordinates = this.addEncounterEndpoints(coordinates, encounters);\n return new LabeledSeries(\n label, coordinates,\n undefined, // unit\n undefined, // legend info,\n abnormal // abnormal points\n );\n }\n\n /**\n * Generates a set of LabeledSeries from the given MedicationOrderSet. It will\n * return one series for all the orders together since the order set\n * represents all orders for the same medication.\n * @param medOrderSet The MedicationOrderSet to chart.\n * @param dateRange The date range displayed on the chart.\n * @param encounters A list of Encounters to use while determining line breaks\n * in series.\n * @param categoricalYPosition If set, we use this y-position for all the\n * datapoints in both returned series. If unset, we use the dosage\n * quantity for each administration as the y-value.\n */\n static fromMedicationOrderSet(\n medOrderSet: MedicationOrderSet, dateRange: Interval,\n encounters: Encounter[], categoricalYPosition?: string): LabeledSeries {\n const data: LabeledSeries[] = [];\n for (const medOrder of medOrderSet.resourceList) {\n // The first series in fromMedicationOrder is all the administrations.\n // The second series (unused in this function) is the end points only.\n data.push(LabeledSeries.fromMedicationOrder(\n medOrder, dateRange, categoricalYPosition)[0]);\n }\n\n // Combine all the series into a single series so that it shows up with\n // the same color.\n let coords = [];\n for (const series of data) {\n for (const coord of series.coordinates) {\n coords.push(coord);\n }\n }\n\n coords = this.addEncounterEndpoints(coords, encounters);\n return new LabeledSeries(\n medOrderSet.label, coords, medOrderSet.unit,\n undefined, // legendInfo\n undefined, // abnormal points\n // Always keep normalRanges undefined for MedicationOrder-based\n // LabeledSeries, as we only show normal ranges for Observations with a\n // normal range given in the data.\n undefined, // normalRanges\n medOrderSet.rxNormCode ? medOrderSet.rxNormCode.displayGrouping :\n undefined);\n }\n\n /**\n * Generates a set of LabeledSeries from the given MedicationOrder. For each\n * order, there are two LabeledSeries -- one for the corresponding\n * MedicationAdministrations, and one for the endpoints displayed for the\n * order.\n * @param order The MedicationOrder to chart.\n * @param dateRange The date range displayed on the chart.\n * @param categoricalYPosition If set, we use this categorical y-position\n * for all the datapoints in both returned series. If unset, we use the\n * dosage quantity for each administration as the numerical y-value.\n */\n static fromMedicationOrder(\n order: MedicationOrder, dateRange: Interval,\n categoricalYPosition?: string): LabeledSeries[] {\n const coordinates = new Array<[DateTime, string | number, string?]>();\n const endpointCoordinates = new Array<[DateTime, string | number]>();\n const medAdminsForOrder = order.administrationsForOrder;\n\n const label = order.label + order.orderId;\n const legend = order.rxNormCode.displayGrouping;\n\n if (medAdminsForOrder) {\n for (const annotatedAdmin of medAdminsForOrder.resourceList) {\n coordinates.push([\n annotatedAdmin.medAdministration.timestamp,\n this.getYPositionForMed(\n annotatedAdmin.medAdministration, categoricalYPosition)\n ]);\n }\n // We add the beginning and end time stamp if the order is not fully\n // displayed-- so that no dashes are displayed when an order is being\n // carried over from before the time window displayed.\n // We only display an endpoint for a MedicationOrder if the\n // endpoint is visible -- that is, if the time of the first\n // Administration of the order is during or after the beginning of the\n // time range of the chart, and if the time of the last Administration\n // of the order is before the end of the chart's time range.\n const firstAdministrationIsAfterStartTime =\n order.firstAdministration.timestamp.toMillis() >=\n dateRange.start.toMillis();\n const lastAdministrationIsBeforeEndTime =\n order.lastAdmininistration.timestamp.toMillis() <=\n dateRange.end.toMillis();\n\n if (firstAdministrationIsAfterStartTime) {\n endpointCoordinates.push([\n order.firstAdministration.timestamp,\n this.getYPositionForMed(\n order.firstAdministration, categoricalYPosition)\n ]);\n } else if (\n categoricalYPosition &&\n (order.lastAdmininistration.timestamp.toMillis() >\n dateRange.start.toMillis())) {\n // Only add a point for continuity if we have a fixed y position.\n coordinates.push([dateRange.start, categoricalYPosition]);\n }\n if (lastAdministrationIsBeforeEndTime) {\n endpointCoordinates.push([\n order.lastAdmininistration.timestamp,\n this.getYPositionForMed(\n order.lastAdmininistration, categoricalYPosition)\n ]);\n } else if (\n categoricalYPosition &&\n order.firstAdministration.timestamp.toMillis() <\n dateRange.end.toMillis()) {\n // Only add a point for continuity if we have a fixed y position.\n coordinates.push([dateRange.end, categoricalYPosition]);\n }\n }\n\n return [\n new LabeledSeries(\n label, coordinates, medAdminsForOrder.unit, legend,\n undefined, // abnormal points\n // Always keep normalRanges undefined for MedicationOrder-based\n // LabeledSeries, as we only show normal ranges for Observations with\n // a normal range given in the data.\n undefined, // normalRanges\n order.rxNormCode.displayGrouping),\n new LabeledSeries(\n 'endpoint' + label, endpointCoordinates, medAdminsForOrder.unit,\n legend)\n ];\n }\n\n /**\n * Generates a LabeledSeries from the given initial date and y-value.\n * @param date The DateTime corresponding to the initial point to chart.\n * @param yValue The y-value for the initial point to chart.\n */\n static fromInitialPoint(date: DateTime, yValue: number) {\n return new LabeledSeries('', [[date, yValue]]);\n }\n\n /**\n * Generates LabeledSeries from the given DiagnosticReport.\n * @param report The DiagnosticReport to chart.\n * @param date the DateTime corresponding to the Observations in the\n * DiagnosticReport.\n */\n static fromDiagnosticReport(report: DiagnosticReport, date: DateTime):\n LabeledSeries[] {\n const series = [];\n const interpretationMap = new Map>();\n // Sort results by interpretation, and make a LabeledSeries for each.\n for (const observation of report.results) {\n const categoricalYValue = observation.display;\n const interpretation = observation.interpretation.code;\n if (interpretationMap.get(interpretation)) {\n const existing = interpretationMap.get(interpretation);\n existing.push([date, categoricalYValue]);\n interpretationMap.set(interpretation, existing);\n } else {\n interpretationMap.set(interpretation, [[date, categoricalYValue]]);\n }\n }\n // Make a LabeledSeries for each interpretation.\n for (const interpretation of Array.from(interpretationMap.keys())) {\n const seriesLabel =\n report.id + '-' + interpretation + '-' + report.status;\n const isPositive = seriesLabel.includes(CHECK_RESULT_CODE);\n series.push(new LabeledSeries(\n // Encode the status and interpretation into the series name so that\n // we can use d3 later on to filter the data points and display them\n // with the correct styling.\n seriesLabel, interpretationMap.get(interpretation),\n undefined, // unit\n LabeledSeries.getLegendInfoFromResult(report.status, isPositive)));\n }\n return series;\n }\n\n /**\n * Returns the correct legend info for a diagnostic report.\n * @param status The DiagnosticReport's status.\n * @param isPositive Whether the report appears to be positive.\n * @returns The correct legend info for the report.\n */\n private static getLegendInfoFromResult(\n status: DiagnosticReportStatus, isPositive: boolean): LegendInfo {\n if (isPositive) {\n if (status === DiagnosticReportStatus.Preliminary) {\n return posPrelimMB;\n } else if (status === DiagnosticReportStatus.Final) {\n return posFinalMB;\n }\n return posOtherNB;\n } else {\n if (status === DiagnosticReportStatus.Preliminary) {\n return negPrelimMB;\n } else if (status === DiagnosticReportStatus.Final) {\n return negFinalMB;\n }\n return negOtherMB;\n }\n }\n\n private static getYPositionForMed(\n medAdmin: MedicationAdministration, categoricalYPosition: string): string\n |number {\n return categoricalYPosition !== undefined && categoricalYPosition !== null ?\n categoricalYPosition :\n medAdmin.dosage.quantity;\n }\n\n private static addEncounterEndpoints(\n coordinates: any[], encounters: Encounter[]): any[] {\n if (coordinates.length > 0) {\n // If any encounters are set for this MedicationOrderSet, add null values\n // to the endpoints of encounters to ensure line breakage between points\n // of different encounters.\n // We assume that encounter endpoints correspond to correct line breaks,\n // and do not cross-check encounter id's of MedicationOrders or\n // MedicationAdministrations.\n coordinates = coordinates.sort((a, b) => a[0] - b[0]);\n for (const encounter of encounters) {\n coordinates.unshift([encounter.period.start.toUTC(), null]);\n coordinates.push([encounter.period.end.toUTC(), null]);\n }\n }\n return coordinates;\n }\n\n hasPointInRange(dateRange: Interval) {\n for (const x of this.coordinates.map(c => c[0])) {\n if (dateRange.contains(x)) {\n return true;\n }\n }\n return false;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {DateTime, Interval} from 'luxon';\n\nimport {ResourceCodeGroup} from '../clinicalconcepts/resource-code-group';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {MedicationOrderSet} from '../fhir-data-classes/medication-order';\nimport {ObservationSet} from '../fhir-data-classes/observation-set';\nimport {MedicationAdministrationTooltip} from '../graphtypes/tooltips/medication-tooltips';\n// tslint:disable-next-line:max-line-length\nimport {DiscreteObservationTooltip, GenericAbnormalTooltip, GenericAnnotatedObservationTooltip} from '../graphtypes/tooltips/observation-tooltips';\nimport {NORMAL} from '../fhir-data-classes/observation-interpretation-valueset';\nimport {bloodPressureLoincs} from '../clinicalconcepts/resource-code-manager-exports';\n\nimport {GraphData} from './graphdata';\nimport {LabeledSeries} from './labeled-series';\n\n/**\n * LineGraphData holds configurations for a line graph. A line graph may display\n * one or more LabeledSeries.\n */\nexport class LineGraphData extends GraphData {\n /** The tick marks to display on the y axis. */\n readonly yTicks: number[];\n\n /**\n * Contains the ResourceCodeGroup for this set of data, which helps determine\n * whether to force display bounds, and the code group's display bounds.\n */\n readonly resourceGroup: ResourceCodeGroup;\n\n\n\n private constructor(\n /** The label for the graph. */\n readonly label: string,\n /** The LabeledSeries that are a part of this line graph. */\n series: LabeledSeries[],\n /** The minimum and maximum y-values for this data. */\n readonly yAxisDataBounds: [number, number],\n /** The unit for the y-axis of the graph. */\n readonly unit: string, tooltipMap?: Map,\n tooltipKeyFn?: (key: string) => string, regions?: any[],\n precision?: number, resourceCodeGroup?: ResourceCodeGroup) {\n super(series, tooltipMap, tooltipKeyFn, regions);\n this.precision = precision ? precision : 0;\n this.yTicks =\n LineGraphData.getYTicks(yAxisDataBounds[0], yAxisDataBounds[1]);\n this.resourceGroup = resourceCodeGroup;\n }\n\n static emptyData() {\n return new LineGraphData('', [], [0, 0], '');\n }\n\n /**\n * Converts a list of ObservationSets to a LineGraphData object.\n * @param label The label for this set of observations.\n * @param observationGroup A list of ObservationSets to display.\n * @param resourceCodeGroup The ResourceCodeGroup these ObservationSets belong\n * to\n * @param sanitizer A DOM sanitizer for use in tooltip construction\n * @param encounters A list of Encounters to use while determining line breaks\n * in series.\n * @returns a new LineGraphData for this observation set.\n * @throws Error if the observations in observationGroup have different units.\n */\n static fromObservationSetList(\n label: string, observationGroup: ObservationSet[],\n resourceCodeGroup: ResourceCodeGroup, sanitizer: DomSanitizer,\n encounters: Encounter[]): LineGraphData {\n let minY: number = Number.MAX_VALUE;\n let maxY: number = Number.MIN_VALUE;\n\n const allSeries = [];\n const obsGroupToSeries = new Map();\n for (const obsSet of observationGroup) {\n const lblSeries = LabeledSeries.fromObservationSet(obsSet, encounters);\n obsGroupToSeries.set(obsSet, lblSeries);\n allSeries.push(lblSeries);\n /* Find the minimum and maximum y values for all the series. */\n if (lblSeries.yDisplayBounds) {\n minY = Math.min(minY, lblSeries.yDisplayBounds[0]);\n maxY = Math.max(maxY, lblSeries.yDisplayBounds[1]);\n }\n }\n\n let tooltipMap = LineGraphData.makeTooltipMap(obsGroupToSeries, sanitizer);\n\n tooltipMap = LineGraphData.addAbnormalValueTooltips(\n tooltipMap, sanitizer, allSeries);\n\n const allUnits =\n new Set(observationGroup.map(x => x.unit).filter(x => x !== undefined));\n\n const data = new LineGraphData(\n label, allSeries, [minY, maxY], allUnits.values().next().value,\n tooltipMap && tooltipMap.size > 0 ? tooltipMap : undefined,\n undefined, // tooltipMap\n undefined, // regions\n resourceCodeGroup.precision, resourceCodeGroup);\n return data;\n }\n\n /**\n * Manually find y axis tick values based on the min and max display bounds.\n */\n static getYTicks(min: number, max: number, tickCount = 4): number[] {\n // Evenly space out 5 numbers between the min and max (display bounds).\n const difference = max - min;\n const spacing = difference / tickCount;\n const values = [];\n // If there is no difference between the min and max, simply return the\n // min.\n if (spacing === 0) {\n return [min];\n }\n for (let curr = min; curr <= max; curr += spacing) {\n values.push(curr);\n }\n return values;\n }\n\n\n private static makeTooltipMap(\n obsGroupToSeries: Map,\n sanitizer: DomSanitizer,\n ): Map {\n const tooltipMap = new Map();\n\n for (const entry of Array.from(obsGroupToSeries.entries())) {\n const obsGroup: ObservationSet = entry[0];\n const series: LabeledSeries = entry[1];\n for (const obs of obsGroup.resourceList) {\n const isAbnormal = series.abnormalCoordinates.has(obs.observation.timestamp.toISO());\n const timestamp = obs.observation.timestamp.toMillis().toString();\n // The key for this tooltip is the administration's timestamp.\n // There may be multiple data points associated with the timestamp\n // so we stack the administrations on top of one another in that case.\n if (tooltipMap.get(timestamp)) {\n // Blood pressure is read into the ObservationSet differently,\n // causing an edge case in the presentation of the values in the\n // tooltips. We only want to display 'Blood pressure' once\n if (obs.observation.codes[0].codeString === bloodPressureLoincs[0].codeString\n && tooltipMap.get(timestamp).includes(bloodPressureLoincs[0].label)) {\n continue;\n }\n tooltipMap.set(\n timestamp,\n tooltipMap.get(timestamp) +\n new GenericAnnotatedObservationTooltip(\n false, series.legendInfo.fill)\n .getTooltip(obs, sanitizer, isAbnormal));\n } else {\n tooltipMap.set(\n timestamp,\n new GenericAnnotatedObservationTooltip(\n true, series.legendInfo.fill)\n .getTooltip(obs, sanitizer, isAbnormal));\n }\n }\n }\n return tooltipMap;\n }\n\n /**\n * Constructs a map of timestamps to GenericAbnormalTooltips for any point\n * with an \"abnormal\" value. Currently, we only use the normal range as\n * reference.\n * @param series The series to construct the tooltip map for.\n * @param tooltipMap The existing tooltips for the series.\n * @param obsLabelToColor A map of Observation label to corresponding color.\n * @param sanitizer A DOM sanitizer for use in tooltip construction\n * @returns a map of timstamp strings to tooltips, with GenericObservation\n * tooltips replaced with GenericAbnormal tooltip if the value is\n * abnormal.\n */\n private static addAbnormalValueTooltips(\n tooltipMap: Map,\n sanitizer: DomSanitizer,\n labeledSeries: LabeledSeries[],\n ): Map {\n const alreadyMarked = new Set();\n for (const series of labeledSeries) {\n // Add a tooltip for any value with an abnormal value.\n for (const coords of series.coordinates) {\n const timestamp = coords[0].toMillis().toString();\n if (series.abnormalCoordinates.has(coords[0].toISO())) {\n const params = {};\n params['timestamp'] = coords[0].toMillis();\n params['value'] = coords[1];\n params['label'] = series.label;\n params['unit'] = series.unit;\n // The key for this tooltip is the timestamp.\n // There may be multiple data points associated with the\n // timestamp so we stack the administrations on top of one\n // another in that case.\n if (tooltipMap.get(timestamp) && !alreadyMarked.has(timestamp)) {\n tooltipMap.set(\n timestamp,\n tooltipMap.get(timestamp) +\n new GenericAbnormalTooltip(false, series.legendInfo.fill)\n .getTooltip(params, sanitizer));\n alreadyMarked.add(timestamp);\n } else if (!tooltipMap.get(timestamp)) {\n tooltipMap.set(\n timestamp,\n new GenericAbnormalTooltip(true, series.legendInfo.fill)\n .getTooltip(params, sanitizer));\n }\n }\n }\n return tooltipMap;\n }\n }\n\n /**\n * Converts a list of MedicationOrderSets to a LineGraphData object.\n * @param medicationOrderListGroup A list of MedicationOrderSets to\n * display.\n * @param encounters A list of Encounters to use while determining line\n * breaks in series.\n * @returns a new LineGraphData for this observation set.\n * @throws Error if the medication administrations in medicationOrderSet\n * have different units.\n */\n static fromMedicationOrderSet(\n medicationOrderSet: MedicationOrderSet, dateRange: Interval,\n sanitizer: DomSanitizer, encounters: Encounter[]): LineGraphData {\n const tooltipMap = new Map();\n const regions = new Array<[DateTime, DateTime]>();\n for (const order of medicationOrderSet.resourceList) {\n regions.push([\n order.firstAdministration.timestamp,\n order.lastAdmininistration.timestamp\n ]);\n for (const admin of order.administrationsForOrder.resourceList) {\n const timestamp =\n admin.medAdministration.timestamp.toMillis().toString();\n // The key for this tooltip is the administration's timestamp.\n // There may be multiple data points associated with the timestamp\n // so we stack the administrations on top of one another in that\n // case.\n const tooltipText = new MedicationAdministrationTooltip().getTooltip(\n [admin], sanitizer);\n if (tooltipMap.get(timestamp)) {\n tooltipMap.set(timestamp, tooltipMap.get(timestamp) + tooltipText);\n } else {\n tooltipMap.set(timestamp, tooltipText);\n }\n }\n }\n\n return new LineGraphData(\n medicationOrderSet.label,\n [LabeledSeries.fromMedicationOrderSet(\n medicationOrderSet, dateRange, encounters)],\n [medicationOrderSet.minDose, medicationOrderSet.maxDose],\n medicationOrderSet.unit, tooltipMap, undefined, regions);\n }\n\n /**\n * Converts a list of ObservationSets with discrete y-values (results) to\n * a LineGraphData object. If we are graphing Observations with discrete\n * values, such as \"yellow\" for the color of urine, we group all\n * ObservationSets into one LabeledSeries, and display textual information\n * in the tooltip.\n * @param label The label for this set of observations.\n * @param observationGroup A list of ObservationSets to display.\n * @param encounters A list of Encounters to use while determining line\n * breaks in series.\n * @returns a new LineGraphData for this observation set.\n * @throws Error if the observations in observationGroup have different\n * units.\n */\n static fromObservationSetListDiscrete(\n label: string, observationGroup: ObservationSet[],\n sanitizer: DomSanitizer, encounters: Encounter[]): LineGraphData {\n // For ObservationSets with discrete categories, we display a\n // scatterplot with one series, with most information in the tooltip.\n const yValue = 10;\n const lblSeries = LabeledSeries.fromObservationSetsDiscrete(\n observationGroup, yValue, label, encounters);\n\n let tooltipMap = new Map();\n for (const observationSet of observationGroup) {\n for (const obs of observationSet.resourceList) {\n const isAbnormal = (obs.observation.interpretation &&\n obs.observation.interpretation.code !== NORMAL) ?\n true : false;\n const tsString = obs.observation.timestamp.toMillis().toString();\n // Only add the timestamp to the tooltip for the first entry.\n let tooltipText: string;\n if (obs.observation.value) {\n tooltipText =\n new GenericAnnotatedObservationTooltip(\n !tooltipMap.has(tsString), lblSeries.legendInfo.fill)\n .getTooltip(obs, sanitizer, isAbnormal);\n } else {\n tooltipText =\n new DiscreteObservationTooltip(!tooltipMap.has(tsString))\n .getTooltip([obs.observation], sanitizer);\n }\n\n // The key for this tooltip is the observation's timestamp.\n // There may be multiple data points associated with the timestamp\n // so we stack the tooltips on top of one another in that case.\n if (tooltipMap.has(tsString)) {\n tooltipMap.set(tsString, tooltipMap.get(tsString) + tooltipText);\n } else {\n tooltipMap.set(tsString, tooltipText);\n }\n }\n }\n tooltipMap = LineGraphData.addAbnormalValueTooltips(\n tooltipMap, sanitizer, [lblSeries]);\n\n return new LineGraphData(\n label, [lblSeries], [0, yValue * 2], undefined, // Units\n tooltipMap);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\n\nimport {AnnotatedDiagnosticReport} from '../fhir-data-classes/annotated-diagnotic-report';\nimport {DiagnosticReport} from '../fhir-data-classes/diagnostic-report';\nimport {MicrobioTooltip} from '../graphtypes/tooltips/microbio-tooltips';\nimport {CHECK_RESULT_CODE} from 'src/app/fhir-data-classes/observation-interpretation-valueset';\n\nimport {LabeledSeries} from './labeled-series';\nimport {StepGraphData} from './stepgraphdata';\n\n/**\n * MicrobioGraphData holds configurations for a microbiology graph. The format\n * of a microbiology graph is simliar to a step graph in that each y-axis\n * position represents a single microbiology test, and points plotted along\n * that position represent results for that test.\n */\n\nexport class MicrobioGraphData extends StepGraphData {\n private constructor(\n endpointSeries: LabeledSeries[], tooltipMap: Map) {\n super(endpointSeries, tooltipMap, undefined);\n }\n\n /**\n * Converts a list of DiagnosticReports to a StepGraphData object.\n * All DiagnosticReports in the list should belong to the same culture type.\n * @param diagnosticReports A list of DiagnosticReports to display.\n * @returns a new StepGraphData for this set.\n */\n static fromDiagnosticReports(\n diagnosticReports: DiagnosticReport[],\n sanitizer: DomSanitizer): MicrobioGraphData {\n const points: LabeledSeries[] = [];\n\n const tooltipMap = new Map();\n\n for (const report of diagnosticReports) {\n // Get the timestamp from the collection time of the specimen.\n const specimen = report.specimen;\n if (specimen) {\n const annotatedReport = new AnnotatedDiagnosticReport(report);\n for (const series of LabeledSeries.fromDiagnosticReport(\n report, annotatedReport.timestamp)) {\n points.push(series);\n const isAbnormal = series.label.includes(CHECK_RESULT_CODE);\n const color = series.legendInfo.fill;\n // For this tooltip, the keys are timestamps.\n if (tooltipMap.has(annotatedReport.timestamp.toMillis().toString())) {\n const existingTT =\n tooltipMap.get(annotatedReport.timestamp.toMillis().toString());\n tooltipMap.set(\n annotatedReport.timestamp.toMillis().toString(),\n existingTT +\n new MicrobioTooltip(false, color).getTooltip(\n annotatedReport, sanitizer, isAbnormal));\n } else {\n tooltipMap.set(\n annotatedReport.timestamp.toMillis().toString(),\n new MicrobioTooltip(true, color).getTooltip(\n annotatedReport, sanitizer, isAbnormal));\n }\n }\n }\n }\n\n return new MicrobioGraphData(points, tooltipMap);\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {DateTime, Interval} from 'luxon';\n\nimport {MedicationOrderSet} from '../fhir-data-classes/medication-order';\nimport {MedicationTooltip} from '../graphtypes/tooltips/medication-tooltips';\n\nimport {GraphData} from './graphdata';\nimport {LabeledSeries} from './labeled-series';\n\n/**\n * StepGraphData holds configurations for a step graph. A step graph displays\n * one or more LabeledSeries.\n */\n\nexport class StepGraphData extends GraphData {\n constructor(\n /** A list of the LabeledSeries data to plot. */\n dataSeries: LabeledSeries[],\n /** A list of the LabeledSeries representing end points. */\n // readonly endpointSeries: LabeledSeries[],\n /** A map of tooltips for the data points. */\n tooltipMap: Map,\n /**\n * The function to call to get the key for the tooltip map for a point.\n */\n keyFn: (data: string) => string) {\n super(dataSeries, tooltipMap, keyFn);\n }\n\n /**\n * Converts a list of MedicationOrderSets to a StepGraphData object.\n * @param medicationOrderListGroup A list of MedicationOrderSets to display.\n * @returns a new StepGraphData for this observation set.\n * @throws Error if the observations in observationGroup have different units.\n */\n static fromMedicationOrderSetList(\n medicationOrderListGroup: MedicationOrderSet[], dateRange: Interval,\n sanitizer: DomSanitizer): StepGraphData {\n const data: LabeledSeries[] = [];\n const endpoints: LabeledSeries[] = [];\n\n medicationOrderListGroup = medicationOrderListGroup.sort((a, b) => {\n return a.resourceList[a.resourceList.length - 1]\n .lastAdmininistration.timestamp.toMillis() -\n b.resourceList[b.resourceList.length - 1]\n .lastAdmininistration.timestamp.toMillis();\n });\n\n const tooltipMap = new Map();\n for (const medOrderSet of medicationOrderListGroup) {\n // Each MedicationOrderSet represents multiple MedicationOrders\n // for the same medicine.\n for (const medOrder of medOrderSet.resourceList) {\n const labeledSeries = LabeledSeries.fromMedicationOrder(\n medOrder, dateRange, medOrder.administrationsForOrder.label);\n const administrationSeries = labeledSeries[0];\n const endpointSeries = labeledSeries[1];\n data.push(administrationSeries);\n endpoints.push(endpointSeries);\n\n // For this custom tooltip, the key is the series ID, and the value is\n // the medication tooltip that shows the first and last doses for the\n // medication.\n tooltipMap.set(\n medOrderSet.rxNormCode.label.toLowerCase() +\n medOrder.firstAdministration.timestamp,\n new MedicationTooltip().getTooltip(medOrder, sanitizer));\n tooltipMap.set(\n medOrderSet.rxNormCode.label.toLowerCase() +\n medOrder.lastAdmininistration.timestamp,\n new MedicationTooltip().getTooltip(medOrder, sanitizer));\n }\n }\n // Do not display the units for Medication administration values on the card\n // for MedicationSummary.\n for (const series of data) {\n series.unit = undefined;\n }\n for (const series of endpoints) {\n series.unit = undefined;\n }\n return new StepGraphData(\n endpoints, // do not render medication administrations, only endpoints\n tooltipMap,\n // Our tooltip key here is the drug name plus the timestamp.\n (tooltipContext: any) => {\n const xValue = tooltipContext.dataPoints[0].label;\n const yValue = tooltipContext.dataPoints[0].value;\n return yValue.toLowerCase() +\n DateTime.fromISO(xValue).toMillis().toString();\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\n\nimport {Axis} from './axis';\n\n/**\n * An AxisGroup is a set of Axes that should be rendered on a single card\n * together.\n *\n * Upon construction, the AxisGroup kicks off a FHIR call to determine whether\n * there is data available for the AxisGroup within the time span of the\n * application. When the promise returns, its result is stored in the\n * dataAvailable class variable.\n *\n * None of the information in AxisGroup changes over the application's\n * lifecycle.\n */\nexport class AxisGroup {\n /**\n * Whether there is data available in the app timescope for this axis group.\n * Marked as public because Angular templates need to get to it, and marked\n * as mutable since it's changed by a promise result, but its value is only\n * set once.\n */\n dataAvailable: boolean = undefined;\n\n /**\n * Constructs an AxisGroup.\n *\n * If label is unset in the constructor, then every axis in axes must have\n * the same label for the constructor to succeed. Similarly, if displayGroup\n * is unset, every axis must have the same resourceGroup.displayGrouping.\n */\n constructor(\n /**\n * The set of axes to be displayed in the same grouping.\n */\n readonly axes: Axis[],\n /**\n * The label for this axis group. If it isn't set here, we'll set it\n * using the label of the contained axes.\n */\n readonly label?: string,\n /**\n * The display grouping for this axis group. If it isn't set here, we'll\n * set it using the display grouping of the contained axes.\n */\n readonly displayGroup?: DisplayGrouping) {\n if (!label) {\n const labelSet = new Set(axes.map(axis => axis.label));\n if (labelSet.size !== 1) {\n throw Error(\n 'The axis group has multiple labels, so we can\\'t pick just one: ' +\n Array.from(labelSet.entries()));\n }\n this.label = axes[0].label;\n }\n\n if (!displayGroup) {\n const allDisplayGroups =\n new Set(axes.map(axis => axis.resourceGroup.displayGrouping.label));\n if (allDisplayGroups.size !== 1) {\n throw Error(\n 'All axes on the same card need to have the same display grouping. Groups:' +\n Array.from(new Set(\n axes.map(axis => axis.resourceGroup.displayGrouping.label))));\n }\n this.displayGroup = axes[0].resourceGroup.displayGrouping;\n }\n\n // Go ahead and make the calls to get whether the data is available.\n Promise.resolve(this.dataAvailableInAppTimeScope());\n }\n\n /**\n * Returns whether there is any data available for any axes in this group\n * within the time scope of the app.\n */\n dataAvailableInAppTimeScope(): Promise {\n if (this.dataAvailable !== undefined) {\n return Promise.resolve(this.dataAvailable);\n }\n return Promise\n .all(this.axes.map(axis => axis.dataAvailableInAppTimeScope()))\n .then(rsc => {\n this.dataAvailable = rsc.some(r => r === true);\n return this.dataAvailable;\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {Interval} from 'luxon';\n\nimport {BCHMicrobioCode, BCHMicrobioCodeGroup} from '../clinicalconcepts/bch-microbio-code';\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\nimport {LOINCCode, LOINCCodeGroup} from '../clinicalconcepts/loinc-code';\nimport {ResourceCodeGroup} from '../clinicalconcepts/resource-code-group';\nimport {RxNormCode} from '../clinicalconcepts/rx-norm';\nimport {RxNormCodeGroup} from '../clinicalconcepts/rx-norm-group';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {MedicationOrder, MedicationOrderSet} from '../fhir-data-classes/medication-order';\nimport {FhirService} from '../fhir.service';\nimport {GraphData} from '../graphdatatypes/graphdata';\nimport {LineGraphData} from '../graphdatatypes/linegraphdata';\nimport {MicrobioGraphData} from '../graphdatatypes/microbiographdata';\nimport {StepGraphData} from '../graphdatatypes/stepgraphdata';\n\nimport {ChartType} from './graph/graph.component';\n\n/**\n * An axis represents one graph to be rendered. It\n * holds values for the type of graph (step, scatter, line, etc) as well as the\n * actual graph data.\n *\n * One axis might have multiple ResourceCodes associated with it, but all of\n * the same type.\n *\n * This class makes the FHIR calls to grab the associated data for the chart.\n */\nexport class Axis {\n /**\n * The chart type for this graph.\n */\n readonly chartType: ChartType;\n\n /**\n * The date range the data is currently loaded for.\n */\n dateRange: Interval;\n\n /**\n * Holds the GraphData already resolved for the class's current date range,\n * unless it hasn't been resolved yet. Then this variable will be undefined,\n * and you need to call updateDateRange to get the data loaded in.\n */\n alreadyResolvedData: GraphData;\n\n /**\n * The associated DisplayGrouping for this graph.\n */\n displayConcept: DisplayGrouping;\n\n /*\n * The label for this axis.\n */\n label: string;\n\n /*\n * Whether to show tick marks for this axis (only changed when results are all\n * qualitative).\n */\n showTicks = true;\n\n /** An error message if there's an error in data retrieval. */\n errorMessage: string;\n\n // The encounters for the date range.\n private encounters: Encounter[] = [];\n\n // Holds the grouping of the resource codes for this axis.\n private allLoinc: boolean;\n private allRx: boolean;\n private allBCHMicrobio: boolean;\n\n /**\n * The constructor for this axis.\n * @param fhirService The FhirService used to make the FHIR calls.\n * @param resourceGroup The ResourceGroup to request data for.\n * @param dateRange: The date range to display on the axis.\n * @param label?: The optional y-axis label for this axis.\n */\n constructor(\n private fhirService: FhirService, private sanitizer: DomSanitizer,\n /**\n * The ResourceCodeGroup for this axis.\n */\n readonly resourceGroup: ResourceCodeGroup,\n /*\n * The label for this axis.\n */\n label?: string) {\n this.chartType = resourceGroup.chartType;\n this.displayConcept = resourceGroup.displayGrouping;\n this.label = label;\n\n const resourceCodeList = this.resourceGroup.resourceCodes;\n // Check that all elements of the resourceCodeList are of the same type.\n this.allLoinc = resourceCodeList.every(code => code instanceof LOINCCode);\n this.allRx = resourceCodeList.every(code => code instanceof RxNormCode);\n this.allBCHMicrobio =\n resourceCodeList.every(code => code instanceof BCHMicrobioCode);\n if (!this.allLoinc && !this.allRx && !this.allBCHMicrobio) {\n throw Error('All resource codes must be of the same type.');\n }\n }\n\n /**\n * Changes this axis' date range and loads in the new graph data accordingly.\n */\n updateDateRange(dateRange: Interval): Promise {\n if (dateRange === this.dateRange) {\n return Promise.resolve(this.alreadyResolvedData);\n }\n // Invalidate the already-resolved data so that the graph data promise\n // has to be re-evaluated.\n this.dateRange = dateRange;\n this.alreadyResolvedData = undefined;\n return this.getDataFromFhir(dateRange).then(\n data => {\n this.alreadyResolvedData = data;\n return data;\n },\n rejection => {\n if (rejection instanceof Error) {\n this.errorMessage = rejection.message;\n } else {\n this.errorMessage = JSON.stringify(rejection, null, 4);\n }\n return LineGraphData.emptyData();\n });\n }\n\n /**\n * Returns whether there is data available for this axis within the\n * application's time scope.\n */\n dataAvailableInAppTimeScope(): Promise {\n return this.resourceGroup.dataAvailableInAppTimeScope();\n }\n\n /**\n * Gets the appropriate GraphData by classifying the resource codes and\n * making the appropriate FHIR calls for data and transformations. If\n * the data is already set in this class, it just returns that data.\n *\n * @returns A GraphData promise that will resolve to the GraphData for\n * this axis's resourceGroup.\n */\n private getDataFromFhir(dateRange: Interval): Promise {\n if (this.alreadyResolvedData) {\n return Promise.resolve(this.alreadyResolvedData);\n }\n\n // Set the encounters for this date range. If the promise fails, the list of\n // encounters is empty.\n this.fhirService.getEncountersForPatient(dateRange).then(e => {\n if (!e) {\n e = [];\n }\n e = e.sort(\n (a, b) => a.period.start.toMillis() - b.period.start.toMillis());\n this.encounters = e;\n }, reject => this.encounters = []);\n\n if (this.allRx) {\n // Prescriptions can be plotted as a step chart or as a line chart.\n if (this.chartType === ChartType.STEP) {\n return this.getStepGraphDataForMedicationSummary(\n this.resourceGroup as RxNormCodeGroup, dateRange);\n } else {\n return this.getLineGraphDataForMedicationDetail(\n this.resourceGroup as RxNormCodeGroup, dateRange);\n }\n }\n\n if (this.allBCHMicrobio) {\n // Microbiology always shows up as a step chart.\n return this.getStepGraphDataForMB(\n this.resourceGroup as BCHMicrobioCodeGroup, dateRange);\n } else {\n // In this case it is all LOINC codes.\n // We use LineGraphData for both ChartType.Scatter and\n // ChartType.Line, for plotting LOINC Codes.\n return (this.resourceGroup as LOINCCodeGroup)\n .getResourceSet(dateRange)\n .then(obsSetList => {\n if (obsSetList) {\n const allUnits = new Set(\n obsSetList.map(x => x.unit).filter(x => x !== undefined));\n // If the observation set contains any qualitative\n // values, even if it's mixed in with quantitative values,\n // we display the discrete linegraph. Similarly, if the\n // observations have different units we display it as a discrete\n // line graph.\n if (obsSetList.some(obsSet => obsSet.anyQualitative) ||\n allUnits.size > 1) {\n this.showTicks = false;\n return LineGraphData.fromObservationSetListDiscrete(\n this.displayConcept.label, obsSetList, this.sanitizer,\n this.encounters);\n }\n return LineGraphData.fromObservationSetList(\n this.displayConcept.label, obsSetList, this.resourceGroup,\n this.sanitizer, this.encounters);\n }\n return LineGraphData.emptyData();\n });\n }\n }\n\n /**\n * Get the data needed for the medication summary.\n * We first get the MedicationAdministrations corresponding to the RxNorms to\n * display on the page, and group them by order id (representing a\n * prescription). We then get the MedicationOrder for each order id, and group\n * those into MedicationOrderSets, where each MedicationOrderSet represents a\n * set of MedicationOrders for a particular medication.\n * @param rxNorms The RxNorms to be displayed in the StepGraphCard.\n */\n getStepGraphDataForMedicationSummary(\n rxNorms: RxNormCodeGroup, dateRange: Interval): Promise {\n return rxNorms.getResourceSet(dateRange).then(medOrderSets => {\n return StepGraphData.fromMedicationOrderSetList(\n medOrderSets.map(x => x.orders), dateRange, this.sanitizer);\n });\n }\n\n getStepGraphDataForMB(bchCodes: BCHMicrobioCodeGroup, dateRange: Interval):\n Promise {\n return bchCodes.getResourceSet(dateRange).then(diagReports => {\n return MicrobioGraphData.fromDiagnosticReports(\n diagReports, this.sanitizer);\n });\n }\n\n /**\n * Issues a FHIR request to get all the meds data for a list of\n * RxNorm codes (medications).\n */\n getLineGraphDataForMedicationDetail(\n rxNorms: RxNormCodeGroup, dateRange: Interval): Promise {\n return rxNorms.getResourceSet(dateRange)\n .then(rxNs => {\n const medOrders: MedicationOrder[] =\n [].concat(...rxNs.map(rx => rx.orders.resourceList));\n return medOrders.map(\n order => order.setMedicationAdministrations(this.fhirService));\n })\n .then(orders => {\n return Promise.all(orders);\n })\n .then(orders => {\n return LineGraphData.fromMedicationOrderSet(\n new MedicationOrderSet(orders), dateRange, this.sanitizer,\n this.encounters);\n });\n }\n\n /**\n * Gets the x regions from the data for this axis.\n */\n getXRegions(): Promise {\n return this.getDataFromFhir(this.dateRange).then(data => {\n return data.xRegions ? data.xRegions : [];\n });\n }\n\n /**\n * Returns whether there's resolved data for this axis.\n */\n dataResolved(): boolean {\n return this.alreadyResolvedData ? true : false;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport * as Color from 'color';\nimport {DateTime} from 'luxon';\n\n/*\n * This class makes an annotation for a particular timestamp with custom notes.\n */\nexport class CustomizableGraphAnnotation {\n // Whether or not the full annotation is shown. If false, only the title of\n // the annotation will show.\n private showDetails: boolean;\n // The width of the annotation.\n readonly annotationWidth = 100;\n // The default height of the annotation.\n readonly annotationHeight = 25;\n // The default y position of the annotation.\n readonly annotationDefaultY = 20;\n\n timestamp: DateTime;\n deleteIcon: HTMLElement;\n editIcon: HTMLElement;\n expandIcon: HTMLElement;\n\n constructor(\n timestamp: DateTime,\n /** The title that will show up in the annotation. */\n readonly title = '',\n /** The description that will show up in the annotation. */\n readonly description = '',\n /** The color for this annotation and associated point. */\n readonly color: Color = Color.rgb('black'),\n /** The timestamp for the annotation */\n ) {\n this.timestamp = timestamp;\n }\n\n addAnnotation(chartDivId: string, differenceInHeight: number): HTMLElement {\n const self = this;\n this.showDetails = false;\n const millis = this.timestamp.toMillis();\n\n const tooltipContainer = document.createElement('div');\n tooltipContainer.setAttribute(\n 'class', 'tooltip-custom-' + chartDivId + millis);\n tooltipContainer.style.left = '0px';\n tooltipContainer.style.borderColor = 'grey';\n tooltipContainer.style.backgroundColor = this.color.toString();\n tooltipContainer.style.bottom =\n (this.annotationDefaultY + differenceInHeight) + 'px';\n\n const tooltipTitleContainer = document.createElement('div');\n tooltipContainer.appendChild(tooltipTitleContainer);\n\n this.expandIcon =\n this.makeIcon('expand-' + chartDivId + millis, 'expand_more');\n this.expandIcon.style.cursor = 'pointer';\n tooltipTitleContainer.appendChild(this.expandIcon);\n\n const tooltipTitle = document.createElement('h6');\n tooltipTitle.setAttribute(\n 'class', 'tooltip-title-custom-' + chartDivId + millis);\n tooltipTitle.innerText = this.title;\n tooltipTitleContainer.appendChild(tooltipTitle);\n\n\n this.deleteIcon = this.makeIcon('delete-' + chartDivId + millis, 'clear');\n this.deleteIcon.style.cursor = 'pointer';\n tooltipTitleContainer.appendChild(this.deleteIcon);\n\n const tooltipDetails = document.createElement('div');\n tooltipDetails.setAttribute(\n 'class', 'tooltip-details-custom-' + chartDivId + millis);\n tooltipContainer.appendChild(tooltipDetails);\n\n const tooltipDetailsText = document.createElement('div');\n tooltipDetailsText.innerText = this.description;\n tooltipDetailsText.setAttribute(\n 'class', 'tooltip-details-text-' + chartDivId + millis);\n tooltipDetails.appendChild(tooltipDetailsText);\n\n this.editIcon = this.makeIcon('edit-' + chartDivId + millis, 'edit');\n this.editIcon.style.cursor = 'pointer';\n tooltipDetails.appendChild(this.editIcon);\n\n /**\n * Add action handlers.\n */\n tooltipTitle.onclick = ((e: MouseEvent) => {\n // Toggle whether or not the details are shown.\n self.showDetails = !self.showDetails;\n self.showDetailsToggle(\n millis, self.showDetails, tooltipContainer, chartDivId);\n });\n\n this.expandIcon.onclick = ((e: MouseEvent) => {\n // Toggle whether or not the details are shown.\n self.showDetails = !self.showDetails;\n self.showDetailsToggle(\n millis, self.showDetails, tooltipContainer, chartDivId);\n });\n\n\n tooltipContainer.onmouseover = (e: MouseEvent) => {\n this.expandIcon.style.visibility = 'visible';\n this.deleteIcon.classList.add('showIcon');\n this.editIcon.classList.add('showIcon');\n };\n\n tooltipContainer.onmouseout = (e: MouseEvent) => {\n this.expandIcon.style.visibility = 'hidden';\n this.deleteIcon.classList.remove('showIcon');\n this.editIcon.classList.remove('showIcon');\n };\n return tooltipContainer;\n }\n\n removeAnnotation(chartDivId: string) {\n const annotation = document.getElementsByClassName(\n 'tooltip-whole-' + chartDivId + this.timestamp.toMillis())[0];\n const parent = annotation.parentNode;\n if (parent) {\n parent.removeChild(annotation);\n }\n }\n\n private makeIcon(id: string, iconName: string): HTMLElement {\n const icon = document.createElement('i');\n icon.setAttribute('class', 'material-icons');\n icon.setAttribute('id', id);\n icon.style.fontSize = '18px';\n icon.innerHTML = iconName;\n return icon;\n }\n // Toggles whether or not the full annotation is shown.\n private showDetailsToggle(\n millis: number, toggle: boolean, element: any, chartDivId: string) {\n const detailsElement =\n document.getElementsByClassName(\n 'tooltip-details-custom-' + chartDivId + millis)[0] as HTMLElement;\n const expandElement =\n document.getElementById('expand-' + chartDivId + millis);\n if (toggle) {\n detailsElement.style.display = 'inline-block';\n expandElement.innerHTML = 'expand_less';\n } else {\n detailsElement.style.display = 'none';\n expandElement.innerHTML = 'expand_more';\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, forwardRef, Inject, Input, OnChanges, OnDestroy, Output, SimpleChanges} from '@angular/core';\nimport {MatDialog} from '@angular/material/dialog';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {DateTime, Interval} from 'luxon';\n// tslint:disable-next-line:max-line-length\nimport {CustomizableTimelineDialogComponent} from 'src/app/cardtypes/customizable-timeline/customizable-timeline-dialog/customizable-timeline-dialog.component';\nimport {CustomizableData} from 'src/app/graphdatatypes/customizabledata';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\nimport {recordGoogleAnalyticsEvent} from 'src/constants';\n\nimport {GraphComponent} from '../graph/graph.component';\n\nimport {CustomizableGraphAnnotation} from './customizable-graph-annotation';\n\n@Component({\n selector: 'app-customizable-graph',\n templateUrl: '../graph/graph.component.html',\n styleUrls: [\n '../../cardtypes/customizable-timeline/customizable-timeline.component.css'\n ],\n providers: [{\n provide: GraphComponent,\n useExisting: forwardRef(() => CustomizableGraphComponent)\n }]\n})\nexport class CustomizableGraphComponent extends\n GraphComponent implements OnChanges, OnDestroy {\n /**\n * An event indicating that the points on the CustomizableGraph have changed.\n */\n @Output() pointsChanged = new EventEmitter();\n /**\n * Holds whether this graph is in edit mode.\n */\n @Input() inEditMode: boolean;\n\n /**\n * The reference for the Dialog opened.\n */\n private dialogRef: any;\n\n\n constructor(\n readonly sanitizer: DomSanitizer, public dialog: MatDialog,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n this.chartTypeString = 'scatter';\n }\n\n ngOnDestroy() {\n if (this.dialogRef && this.dialogRef.unsubscribe) {\n // Destroy the dialog ref to prevent memory leaks.\n this.dialogRef.unsubscribe();\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n super.ngOnChanges(changes);\n if (changes.dateRange) {\n // CustomizableGraph needs to update annotations in the case that the date\n // range is changed.\n this.dateRangeChanged();\n }\n }\n adjustGeneratedChartConfiguration() {\n const self = this;\n this.chartOptions.scales.yAxes[0].display = false;\n this.chartOptions.scales.yAxes[0].ticks.beginAtZero = true;\n this.chartOptions.tooltips = {enabled: false};\n this.chartOptions.hover = {mode: null};\n this.chartOptions.onClick = function(event) {\n if (!self.inEditMode) {\n return;\n }\n const xValueMoment =\n this.scales[GraphComponent.X_AXIS_ID].getValueForPixel(event.offsetX);\n const dateClicked = DateTime.fromJSDate(xValueMoment.toDate());\n const currentInterval = Interval.fromDateTimes(\n self.dateRange.start.toLocal().startOf('day'),\n self.dateRange.end.toLocal().endOf('day'));\n if (currentInterval.contains(dateClicked)) {\n self.openDialog(dateClicked);\n }\n };\n this.chartOptions.onHover = function(event) {\n if (!self.inEditMode) {\n return;\n }\n const chart: any = this;\n const yScale = chart.scales[GraphComponent.Y_AXIS_ID];\n const xScale = chart.scales[GraphComponent.X_AXIS_ID];\n const currentDate =\n DateTime.fromJSDate(xScale.getValueForPixel(event.offsetX).toDate());\n const currentDateString = currentDate.toLocaleString() + ' ' +\n currentDate.toLocal().toLocaleString(DateTime.TIME_24_SIMPLE);\n\n const currentInterval = Interval.fromDateTimes(\n self.dateRange.start.toLocal().startOf('day'),\n self.dateRange.end.toLocal().endOf('day'));\n\n // Remove all other ctx lines drawn, to only show one hover line.\n chart.clear();\n chart.draw();\n\n // Only display the hover line if the date it represents is within the\n // current date range. This is because the chart is slightly larger than\n // the area contained within the axes, and a line could potentially be\n // shown before the x-axis starts, or after it ends.\n if (currentInterval.contains(currentDate)) {\n chart.ctx.beginPath();\n chart.ctx.moveTo(event.offsetX, 0);\n chart.ctx.strokeStyle = '#A0A0A0';\n chart.ctx.lineTo(event.offsetX, yScale.bottom);\n chart.ctx.stroke();\n chart.ctx.fillText(currentDateString, event.offsetX, yScale.bottom / 2);\n }\n };\n this.chartOptions.animation = {\n onComplete: function(chart) {\n self.removeAnnotations();\n self.addAnnotations();\n }\n };\n }\n\n dateRangeChanged() {\n this.reloadChart();\n this.adjustGeneratedChartConfiguration();\n }\n\n addAnnotations() {\n for (const dataPt of this.chartData[0].data) {\n const canvas = document.getElementById(this.chartDivId);\n const millis = DateTime.fromISO(dataPt['x']).toMillis();\n const annotation = this.data.annotations.get(millis);\n const color = annotation.color ? annotation.color : '#000000';\n // We need to cast this.chart.chart as any so we can access the 'scales'\n // property.\n const xOffset = (this.chart.chart as any)\n .scales[GraphComponent.X_AXIS_ID]\n .getPixelForValue(annotation.timestamp.toJSDate());\n const yOffset = (this.chart.chart as any)\n .scales[GraphComponent.Y_AXIS_ID]\n .margins['bottom'];\n const yAxisHeight =\n (this.chart.chart as any).scales[GraphComponent.Y_AXIS_ID].height;\n const heightToUse =\n this.findBestYCoordinate(xOffset, yAxisHeight, yOffset);\n const difference = heightToUse - yOffset;\n\n // Only display the flag if the date it represents is within the\n // current date range. This is so that the flag is not added to a location\n // on the DOM that is not within the chart.\n if (this.entireInterval.contains(DateTime.fromMillis(millis).toLocal())) {\n const tooltip = this.findOrCreateTooltipElement(\n canvas, 'annotation-' + this.chartDivId + millis);\n tooltip.setAttribute(\n 'class', 'tooltip-whole-' + this.chartDivId + millis);\n tooltip.style.borderLeftColor = color;\n tooltip.style.bottom = yOffset + 'px';\n tooltip.style.left = xOffset + 'px';\n tooltip.style.height = heightToUse + 'px';\n while (tooltip.firstChild) {\n tooltip.removeChild(tooltip.firstChild);\n }\n tooltip.onclick = (e: MouseEvent) => {\n const parent = tooltip.parentNode;\n try {\n parent.appendChild(tooltip);\n } catch (e) {\n console.log(e);\n }\n };\n\n tooltip.appendChild(\n annotation.addAnnotation(this.chartDivId, difference));\n this.addDeleteEvent(annotation);\n this.addEditListener(annotation);\n }\n }\n }\n\n private removeAnnotations() {\n const selector = 'tooltip-whole-' + this.chartDivId;\n for (const annotation of Array.from(\n document.querySelectorAll('[class*=' + selector + ']'))) {\n const parent = annotation.parentNode;\n if (parent) {\n parent.removeChild(annotation);\n }\n }\n }\n\n private findBestYCoordinate(\n xOffset: number, yAxisHeight: number, yOffset: number): number {\n const annotationWidth = 100;\n const verticalOverlap = 10;\n const horizontalOverlap = 20;\n const selector = 'tooltip-whole-' + this.chartDivId;\n const allFlags =\n Array.from(document.querySelectorAll('[class*=' + selector + ']'));\n const positions = allFlags.map(flag => {\n const htmlFlag = flag as HTMLElement;\n return {\n left: Number(htmlFlag.style.left.replace('px', '')),\n height: Number(htmlFlag.style.height.replace('px', '')),\n };\n });\n const overlappingYs = [];\n // Check if there are any annotations with horizontal overlap.\n for (const position of positions) {\n const leftPosition = position.left + annotationWidth;\n if (xOffset <= leftPosition &&\n (xOffset + annotationWidth >= position.left)) {\n overlappingYs.push(position.height);\n }\n }\n\n // Figure out the new y-coordinate for the annotation.\n let heightToUse = yOffset;\n // Sort all heights in increasing order.\n overlappingYs.sort(function(a, b) {\n return a - b;\n });\n // By default, try putting the new box above all other annotations with\n // horizontal overlap.\n if (overlappingYs.length > 0) {\n const currentMaxHeight = overlappingYs[overlappingYs.length - 1];\n // Only add height if the annotation does not go past the y axis height.\n if (currentMaxHeight + verticalOverlap <= yAxisHeight) {\n heightToUse = currentMaxHeight + verticalOverlap;\n } else {\n heightToUse = currentMaxHeight;\n }\n }\n // Check if there is any position with space available between existing\n // annotations.\n for (let i = 0; i < overlappingYs.length; i++) {\n // Check if there is enough space.\n if (overlappingYs[i + 1] - (overlappingYs[i] + annotationWidth) >=\n horizontalOverlap) {\n heightToUse = overlappingYs[i];\n }\n }\n return heightToUse;\n }\n\n // If the selected date already has an annotation, modify the time\n // by + 1 millisecond.\n private updateTime(millis: number) {\n if (this.data.annotations.has(millis)) {\n return this.updateTime(millis + 1);\n }\n return millis;\n }\n\n /**\n * Allow for the addition of a point to the CustomizableGraph, via a\n * CustomizableTimelineDialog.\n * (Visible only for testing.)\n */\n addPoint(timestamp: DateTime) {\n if (this.inEditMode) {\n this.dialogRef = this.openDialog(timestamp);\n }\n }\n\n private openDialog(\n timestamp: DateTime, editedAnnotation?: CustomizableGraphAnnotation) {\n // Make the dialog show up near where the user clicked.\n const data = editedAnnotation ? {\n title: editedAnnotation.title,\n date: new Date(editedAnnotation.timestamp.toMillis()),\n description: editedAnnotation.description,\n color: editedAnnotation.color,\n dateRange: this.dateRange,\n } :\n {\n date: timestamp,\n dateRange: this.dateRange,\n };\n\n this.dialogRef =\n this.dialog.open(CustomizableTimelineDialogComponent, {data: data});\n this.dialogRef.afterClosed().subscribe(r => {\n if (r) {\n if (editedAnnotation) {\n this.data.removePointFromSeries(\n DateTime.fromMillis(editedAnnotation.timestamp.toMillis()));\n editedAnnotation.removeAnnotation(this.chartDivId);\n }\n\n const result: CustomizableGraphAnnotation =\n r as CustomizableGraphAnnotation;\n // By default, the user selected date is the original date\n // corresponding to where the user chose to add the point.\n let userSelectedDate = result.timestamp;\n userSelectedDate =\n DateTime.fromMillis(this.updateTime(userSelectedDate.toMillis()));\n result.timestamp = userSelectedDate;\n this.data.addPointToSeries(result);\n this.pointsChanged.emit(this.data);\n this.generateChart();\n\n recordGoogleAnalyticsEvent(\n 'addEventCustomTimeline', 'customTimeline',\n new Date().toDateString());\n }\n });\n }\n\n /**\n * Add a listener for a click event on the delete button of the annotation at\n * the given time.\n * @param annotation The annotation for this point to remove.\n */\n private addDeleteEvent(annotation: CustomizableGraphAnnotation) {\n annotation.deleteIcon.onclick = ((e: MouseEvent) => {\n this.data.removePointFromSeries(annotation.timestamp);\n annotation.removeAnnotation(this.chartDivId);\n this.pointsChanged.emit(this.data);\n this.generateChart();\n });\n }\n\n /**\n * Add a listener for a click event on the edit button of the annotation at\n * the given time.\n * Visible only for testing.\n * @param annotation The annotation for the point to edit.\n */\n addEditListener(annotation: CustomizableGraphAnnotation) {\n annotation.editIcon.onclick = ((e: MouseEvent) => {\n this.dialogRef = this.openDialog(annotation.timestamp, annotation);\n\n recordGoogleAnalyticsEvent(\n 'editEventCustomTimeline', 'customTimeline',\n new Date().toDateString());\n });\n }\n}\n","module.exports = \"::ng-deep canvas {\\n -moz-user-select: none;\\n -webkit-user-select: none;\\n -ms-user-select: none;\\n cursor: pointer;\\n}\\n::ng-deep .chartjs-tooltip {\\n opacity: 1;\\n position: absolute;\\n pointer-events: none;\\n /* Show the tooltip above everything else. */\\n z-index: 1000;\\n}\\n::ng-deep .chartjs-tooltip-key {\\n display: inline-block;\\n width: 10px;\\n height: 10px;\\n margin-right: 10px;\\n}\\n/* All the below styles apply to elements within the graphs. Because these\\nare nested inside the components and within C3 divs, we have to prefix the\\nstyle names with ::ng-deep. */\\n::ng-deep .c3-tooltip {\\n font-size: 13px;\\n border-collapse: collapse;\\n border-spacing: 0;\\n background-color: #fff;\\n empty-cells: show;\\n box-shadow: 7px 7px 12px -9px #777777;\\n opacity: 0.9;\\n}\\n::ng-deep table {\\n background: #fff;\\n border: solid 1px #ddd;\\n}\\n::ng-deep .c3-tooltip tr {\\n border: 1px solid #CCC;\\n}\\n::ng-deep .c3-tooltip > tbody > tr > th {\\n width: 100%;\\n word-wrap: break-word;\\n background-color: #aaa;\\n font-size: 14px;\\n padding: 2px 5px;\\n text-align: left;\\n color: #FFF;\\n}\\n::ng-deep .c3-tooltip td {\\n width: 125px;\\n font-size: 13px;\\n padding: 3px 6px;\\n background-color: #fff;\\n border-left: 1px dotted #999;\\n}\\n::ng-deep .order-region {\\n fill: rgb(179, 157, 219); /* Secondary color */\\n stroke: rgb(179, 157, 219); /* Secondary color */\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvZ3JhcGh0eXBlcy9ncmFwaC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxzQkFBc0I7RUFDdEIseUJBQXlCO0VBQ3pCLHFCQUFxQjtFQUNyQixlQUFlO0FBQ2pCO0FBQ0E7RUFDRSxVQUFVO0VBQ1Ysa0JBQWtCO0VBQ2xCLG9CQUFvQjtFQUNwQiw0Q0FBNEM7RUFDNUMsYUFBYTtBQUNmO0FBRUE7RUFDRSxxQkFBcUI7RUFDckIsV0FBVztFQUNYLFlBQVk7RUFDWixrQkFBa0I7QUFDcEI7QUFFQTs7OEJBRThCO0FBRTlCO0VBQ0UsZUFBZTtFQUNmLHlCQUF5QjtFQUN6QixpQkFBaUI7RUFDakIsc0JBQXNCO0VBQ3RCLGlCQUFpQjtFQUdqQixxQ0FBcUM7RUFDckMsWUFBWTtBQUNkO0FBRUE7RUFDRSxnQkFBZ0I7RUFDaEIsc0JBQXNCO0FBQ3hCO0FBRUE7RUFDRSxzQkFBc0I7QUFDeEI7QUFFQTtFQUNFLFdBQVc7RUFDWCxxQkFBcUI7RUFDckIsc0J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xcHggZG90dGVkICM5OTk7XG59XG5cbjo6bmctZGVlcCAub3JkZXItcmVnaW9uIHtcbiAgZmlsbDogcmdiKDE3OSwgMTU3LCAyMTkpOyAvKiBTZWNvbmRhcnkgY29sb3IgKi9cbiAgc3Ryb2tlOiAgcmdiKDE3OSwgMTU3LCAyMTkpOyAvKiBTZWNvbmRhcnkgY29sb3IgKi9cbn1cbiJdfQ== */\"","module.exports = \"\\n
\\n
\\n \\n
\\n
\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Inject, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {Chart, ChartDataSets, ChartOptions, ChartXAxe, ChartYAxe} from 'chart.js';\nimport * as pluginAnnotations from 'chartjs-plugin-annotation';\nimport {DateTime, Interval} from 'luxon';\nimport {BaseChartDirective, Color} from 'ng2-charts';\nimport {GraphData} from 'src/app/graphdatatypes/graphdata';\nimport {LabeledSeries} from 'src/app/graphdatatypes/labeled-series';\nimport {LineGraphData} from 'src/app/graphdatatypes/linegraphdata';\nimport {UI_CONSTANTS, UI_CONSTANTS_TOKEN} from 'src/constants';\nimport {v4 as uuid} from 'uuid';\n\nimport {StandardTooltip} from '../tooltips/tooltip';\n\nexport enum ChartType {\n SCATTER,\n LINE,\n STEP,\n MICROBIO\n}\n\n/**\n * Displays a graph. T is the data type the graph is equipped to display.\n */\nexport abstract class GraphComponent implements OnInit,\n OnChanges {\n /** Dummy data series label. */\n private static readonly DEFAULT_BLANK_DATA_LABEL = 'blankdatalabel';\n\n /**\n * The amount of padding to add to the left of the graph. This goes hand in\n * hand with how we choose to wrap the labels in the rendered chart, so if\n * Y_AXIS_TICK_MAX changes, this probably needs to change, too.\n */\n private static readonly Y_AXIS_LEFT_PADDING = 125;\n\n /** Line weights for emphasized and non-emphasized line graphs. */\n private static readonly THICK_LINE = 3;\n private static readonly THIN_LINE = 1;\n\n /** Constants for x and y axis names. */\n static readonly Y_AXIS_ID = 'y-axis-0';\n static readonly X_AXIS_ID = 'x-axis-0';\n\n /** The base chart height to use when rendering. */\n readonly BASE_CHART_HEIGHT_PX = 150;\n\n /**\n * The entire interval represented by the current date range. This Interval\n * goes from the beginning of the first day of the date range, to the end of\n * the last day of the date range.\n */\n protected entireInterval: Interval;\n\n /** Whether data is available for this graph for the current date range. */\n private dataPointsInDateRange = false;\n\n /*****************************************\n * Bound input variables\n */\n\n /** The x-axis eventlines to display on the chart. */\n @Input() eventlines: Array<{[key: string]: number | string}>;\n /** The x-axis to use for the chart. */\n @Input() dateRange: Interval;\n /** The y-axis label to display. */\n @Input() axisLabel: string;\n /** The graph data to show. */\n @Input() data: T;\n /** The x regions to mark on this graph. */\n @Input() xRegions: Array<[DateTime, DateTime]>;\n\n /*****************************************\n * Variables the chart.js directive binds to.\n */\n\n @ViewChild(BaseChartDirective) chart: BaseChartDirective;\n /** Plugins for chart.js. */\n chartPlugins = [pluginAnnotations];\n\n // The bindings are unhappy when you provide an empty data array, so we\n // give it a fake series to render.\n /**\n * The chart data sets to render.\n */\n chartData: ChartDataSets[] = [\n {data: [], label: GraphComponent.DEFAULT_BLANK_DATA_LABEL},\n ];\n\n /**\n * Chart options to be rendered.\n */\n readonly chartOptions: (ChartOptions&{annotation: any}) = {\n // Draw straight lines between points instead of curves.\n elements: {line: {tension: 0}},\n layout: {padding: {top: 15}},\n // We make our own legend so we don't show the built-in one.\n legend: {display: false},\n scales: {xAxes: [this.generateXAxis()], yAxes: [this.generateYAxis()]},\n // Needed to grow the graph to fit the space.\n responsive: true,\n maintainAspectRatio: false,\n // Set up the custom callback for the tooltips.\n tooltips: {\n enabled: false,\n position: 'nearest',\n /**\n * Sets the tooltip for the graph.\n * If the class has a tooltipMap set, then we look up the tooltip from\n * that map. If there's no tooltipMap, then we return a simple formatted\n * tooltip of just the string representing the data plus the appropriate\n * units for a linegraph, or just the unedited value if it's a different\n * kind of graph.\n */\n custom:\n (tooltipContext) => {\n // Get, or construct, a tooltip element to put all the tooltip HTML\n // into.\n const canvas = document.getElementById(this.chartDivId);\n const tooltipEl = this.findOrCreateTooltipElement(\n canvas, 'chartjs-tooltip' + this.chartDivId);\n\n // Hide the element if there is no tooltip-- this function gets\n // called back whether you're hovering over an element or not.\n if (tooltipContext.opacity === 0) {\n tooltipEl.style.opacity = '0';\n return;\n }\n\n if (tooltipContext.body) {\n tooltipEl.innerHTML = this.getTooltipInnerHtml(tooltipContext);\n }\n\n // Display the tooltip lined up with the data point.\n const positionY = canvas.offsetTop;\n const positionX = canvas.offsetLeft;\n tooltipEl.style.opacity = '1';\n tooltipEl.style.left = positionX + tooltipContext.caretX + 'px';\n tooltipEl.style.top = positionY + tooltipContext.caretY + 'px';\n }\n },\n annotation: {\n // Array of annotation configuration objects to be filled in.\n annotations: []\n },\n // Disable any visual changes on hovering.\n hover: {mode: null},\n /** The settings below are just for better performance. */\n animation: {duration: 0},\n responsiveAnimationDuration: 0\n };\n\n /** A unique identifier for the element to bind the graph to. */\n chartDivId: string;\n\n /**\n * The default chart type for this chart. The Angular directive binds\n * to this string to tell chart.js which chart type to use.\n */\n chartTypeString = 'line';\n\n constructor(\n readonly sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n // Generate a unique ID for this chart.\n const chartId = uuid();\n // Replace the dashes in the UUID to meet HTML requirements.\n const re = /\\-/gi;\n this.chartDivId = 'chart' + chartId.replace(re, '');\n }\n\n ngOnInit() {\n this.generateChart();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes.eventlines) {\n this.updateEventlines(changes.eventlines.currentValue);\n }\n if (changes.dateRange) {\n this.chartOptions.scales.xAxes = [this.generateXAxis()];\n this.entireInterval = Interval.fromDateTimes(\n this.dateRange.start.toLocal().startOf('day'),\n this.dateRange.end.toLocal().endOf('day'));\n }\n if (changes.xRegions) {\n this.showXRegions();\n }\n }\n\n /**\n * When the component gets initialized and upon updates, this series of calls\n * modifies the data-bound variables so that the correct chart gets rendered.\n *\n * 1) prepareForChartConfiguration: an overrideable function in which\n * subclasses can get things ready for the chart to load in data\n * 2) generateBasicChart: load in the chart data and do formatting that all\n * subclasses share in common\n * 3) adjustGeneratedChartConfiguration: make any tweaks to the chart\n * that couldn't be made until the data got loaded in\n */\n\n generateChart(focusOnSeries?: LabeledSeries[]) {\n if (this.data && this.dateRange) {\n this.chartData =\n [{data: [], label: GraphComponent.DEFAULT_BLANK_DATA_LABEL}];\n this.entireInterval = Interval.fromDateTimes(\n this.dateRange.start.toLocal().startOf('day'),\n this.dateRange.end.toLocal().endOf('day'));\n this.dataPointsInDateRange = this.data.dataPointsInRange(this.dateRange);\n this.prepareForChartConfiguration();\n this.generateBasicChart(focusOnSeries);\n this.adjustGeneratedChartConfiguration();\n }\n }\n\n updateEventlines(eventlines: Array<{[key: string]: number | string}>) {\n const currentInterval = Interval.fromDateTimes(\n this.dateRange.start.toLocal().startOf('day'),\n this.dateRange.end.toLocal().endOf('day'));\n this.chartOptions.annotation.annotations =\n this.chartOptions.annotation.annotations.filter(\n a => !(a.id && a.id.includes('eventline')));\n if (this.chart) {\n for (const eventline of eventlines) {\n const currentDate = DateTime.fromMillis(Number(eventline.value));\n if (currentInterval.contains(currentDate)) {\n const line = {\n type: 'line',\n mode: 'vertical',\n id: 'eventline' + eventline.value,\n scaleID: GraphComponent.X_AXIS_ID,\n value: currentDate.toJSDate(),\n borderColor: eventline.color,\n borderWidth: 2,\n };\n this.chartOptions.annotation.annotations.push(line);\n }\n }\n this.reloadChart();\n }\n }\n\n reloadChart() {\n if (this.chart !== undefined && this.chart.chart !== undefined) {\n this.chart.chart.destroy();\n\n this.chart.datasets = this.chartData;\n this.chart.options = this.chartOptions;\n this.chart.ngOnInit();\n }\n }\n\n /**\n * Lines up any extra things needed to generate the\n * chart. Override this function when you need to make changes before the data\n * is loaded into the chart or when you need to load more data into the chart.\n */\n prepareForChartConfiguration() {}\n\n /**\n * Tweaks the generated chart. Override this function when you need to make\n * changes based on the data loaded into the chart.\n */\n adjustGeneratedChartConfiguration() {}\n\n /**\n * Sets up a generalized c3.ChartConfig for the data passed in. See\n * the type definition at:\n * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/c3/index.d.ts\n */\n private generateBasicChart(focusOnSeries?: LabeledSeries[]) {\n // Transform the data into a format that chart.js can render it.\n Chart.defaults.global.defaultFontFamily = 'Work Sans';\n const data = [];\n for (const series of this.data.series) {\n let lineWidth: number = GraphComponent.THIN_LINE;\n if (focusOnSeries !== undefined && focusOnSeries.includes(series)) {\n lineWidth = GraphComponent.THICK_LINE;\n }\n if (series.coordinates.length > 0) {\n data.push({\n data: series.coordinates.map(pt => {\n return {x: pt[0].toISO(), y: pt[1]};\n }),\n label: series.label,\n // Do not fill the area under the line.\n fill: false,\n borderWidth: lineWidth,\n pointBorderWidth: 2,\n pointRadius: 3,\n backgroundColor: series.legendInfo.fill,\n borderColor: series.legendInfo.fill,\n pointBackgroundColor: series.legendInfo.fill,\n pointBorderColor: series.legendInfo.outline,\n });\n }\n }\n\n // The subclasses may have already put series in lineChartData, and\n // we don't want to remove them, so we just append them to the\n // series. On the other hand, if there's a blank series in\n // lineChartData, we want to get rid of it before putting everything\n // else in.\n if (data.length > 0 && this.onlyDefaultDataPresent()) {\n this.chartData = data;\n } else {\n this.chartData = this.chartData.concat(data);\n }\n\n // Set the axis label if it's provided.\n this.chartOptions.scales.yAxes[0].scaleLabel.labelString = this.axisLabel ?\n this.axisLabel.substr(0, 10) +\n (this.axisLabel.length > 10 ? '...' : '') :\n '';\n\n // Add left-padding so that the y-axes are aligned with one another.\n this.chartOptions.scales.yAxes[0]['afterSetDimensions'] = function(axes) {\n axes.paddingLeft = GraphComponent.Y_AXIS_LEFT_PADDING;\n };\n\n const self = this;\n this.chartOptions.animation.onComplete = function(chart) {\n self.showNoDataLabel(this);\n };\n }\n\n private showXRegions() {\n if (!this.xRegions) {\n return;\n }\n for (const region of this.xRegions) {\n const annotation = {\n // Show the region underneath the data points.\n drawTime: 'beforeDatasetsDraw',\n type: 'box',\n xMin: region[0].toMillis(),\n xMax: region[1].toMillis(),\n xScaleID: GraphComponent.X_AXIS_ID,\n yScaleID: GraphComponent.Y_AXIS_ID,\n backgroundColor: 'rgba(179, 157, 219, 0.3)', // purple secondary color\n borderColor: 'rgba(179, 157, 219, 0.4)', // purple secondary color\n borderWidth: 1,\n };\n this.chartOptions.annotation.annotations.push(annotation);\n }\n this.reloadChart();\n }\n\n showNoDataLabel(chart: any) {\n if (!this.dataPointsInDateRange) {\n // Remove all other ctx objects drawn.\n chart.clear();\n chart.draw();\n\n const xCoordinate = chart.width / 2;\n const yCoordinate = chart.height / 2;\n chart.ctx.textAlign = 'center';\n chart.ctx.fillText(\n UI_CONSTANTS.NO_DATA_AVAILABLE_TMPL +\n this.entireInterval.start.toLocal().toLocaleString() + ' and ' +\n this.entireInterval.end.toLocal().toLocaleString(),\n xCoordinate, yCoordinate);\n }\n }\n\n protected onlyDefaultDataPresent() {\n return this.chartData.length === 1 &&\n this.chartData[0].label === GraphComponent.DEFAULT_BLANK_DATA_LABEL;\n }\n\n /***************************\n * Legend interactions\n */\n\n resetChart() {\n this.generateChart();\n }\n\n focusOnSeries(labeledSeries: LabeledSeries[]) {\n this.generateChart(labeledSeries);\n }\n\n /******************************\n * Helper functions for tooltipping\n */\n\n /**\n * Finds or creates a HTML element to render the tooltip onto.\n * @param canvas The Canvas this graph is rendered on\n * @param uniqueId The unique ID to give to this element. If not provided,\n * will use 'chartjs-tooltip' + the chart div ID.\n */\n protected findOrCreateTooltipElement(canvas: HTMLElement, uniqueId: string):\n HTMLElement {\n const tooltipTag =\n uniqueId ? uniqueId : 'chartjs-tooltip' + this.chartDivId;\n let tooltipEl = document.getElementById(tooltipTag);\n if (!tooltipEl) {\n tooltipEl = document.createElement('div');\n tooltipEl.id = tooltipTag;\n tooltipEl.classList.add('chartjs-tooltip');\n tooltipEl.innerHTML = '
';\n canvas.parentNode.appendChild(tooltipEl);\n }\n return tooltipEl;\n }\n\n /**\n * Gets the tooltip text for the given context.\n * @param tooltipContext The tooltip context passed into the tooltip\n * callback\n */\n private getTooltipInnerHtml(tooltipContext: any): string {\n // We squish together all points at the same timestamp preemptively\n // in our tooltip creation so that we just find the index of the\n // tooltip based on the first point's x-value.\n const xValue = tooltipContext.dataPoints[0].label;\n\n const timestampKey = DateTime.fromISO(xValue).toMillis().toString();\n // Our data class may provide a tooltip key function that will\n // get the correct identifier from the data point. If it does,\n // we'll use that, but by default, the key is the timestamp\n // of the data point.\n const keyToUse = this.data.tooltipKeyFn ?\n this.data.tooltipKeyFn(tooltipContext) :\n timestampKey;\n\n // If something bad happens and we don't have a tooltip for the\n // key, return a generic tooltip with the value.\n let tooltipText;\n if (!this.data.tooltipMap || !this.data.tooltipMap.has(keyToUse)) {\n tooltipText =\n new StandardTooltip(\n [], undefined,\n this.data instanceof LineGraphData ? this.data.unit : '')\n .getTooltip(undefined, this.sanitizer);\n } else {\n tooltipText = this.data.tooltipMap.get(keyToUse);\n }\n return tooltipText;\n }\n\n /*************************\n * Helper functions for other chart options\n */\n protected generateXAxis(): ChartXAxe {\n return {\n id: GraphComponent.X_AXIS_ID,\n type: 'time',\n gridLines: {display: true, drawOnChartArea: false},\n time: {\n // This sets the bounds of the x-axis. The default values of 0 and 10\n // are nonsensical but necessary since the graph is first rendered\n // before dateRange is bound.\n min: this.dateRange ? this.dateRange.start.toISO() :\n DateTime.utc().toISO(),\n max: this.dateRange ? this.dateRange.end.toISO() :\n DateTime.utc().toISO(),\n // If we're showing fewer than three days, go for the hour axis labels;\n // otherwise go with by-day axis labels.\n unit: this.dateRange && (this.dateRange.length('day') > 3) ? 'day' :\n 'hour',\n displayFormats: {\n hour: 'MM/DD H:mm',\n day: 'MM/DD',\n }\n },\n ticks: {\n // Only show as many tick labels will fit neatly on the axis.\n autoSkip: true,\n display: true\n },\n scaleLabel: {fontFamily: 'Work Sans'}\n };\n }\n\n private generateYAxis(): ChartYAxe {\n return {\n id: GraphComponent.Y_AXIS_ID,\n position: 'left',\n // Show tick marks but not grid lines.\n gridLines: {display: true, drawOnChartArea: false},\n scaleLabel: {\n display: true,\n labelString: '',\n },\n ticks: {\n // We explicitly set the y values to show, so we don't want to use\n // autoskip.\n autoSkip: false,\n callback: (value, index, values) => {\n if (!this.data) {\n return value;\n }\n return (value).toLocaleString('en-us', {\n minimumFractionDigits: this.data.precision,\n maximumFractionDigits: this.data.precision\n });\n }\n }\n };\n }\n}\n","\n// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nimport * as Color from 'color';\nimport * as Colors from '../theme/verily_colors';\n/**\n * Represents how a concept will be displayed in a legend, with a label, fill\n * color, and outline color.\n */\nexport class LegendInfo {\n private static colorIdx = 0;\n constructor(\n readonly label: string, readonly fill?: Color, readonly outline?: Color) {\n let tempColor: Color = fill;\n if (!fill) {\n tempColor = Colors.getDataColors()[LegendInfo.colorIdx];\n LegendInfo.colorIdx =\n (LegendInfo.colorIdx + 1) % Colors.getDataColors().length;\n }\n this.fill = tempColor;\n this.outline = outline ? outline : tempColor;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, forwardRef, Inject, Input, OnChanges, SimpleChanges} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {ChartPoint} from 'chart.js';\nimport {LabeledSeries} from 'src/app/graphdatatypes/labeled-series';\nimport {LineGraphData} from 'src/app/graphdatatypes/linegraphdata';\nimport {ABNORMAL} from 'src/app/theme/verily_colors';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\nimport {DateTime} from 'luxon';\n\nimport {GraphComponent} from '../graph/graph.component';\n\n@Component({\n selector: 'app-linegraph',\n templateUrl: '../graph/graph.component.html',\n styleUrls: ['../graph.css'],\n providers: [\n {provide: GraphComponent, useExisting: forwardRef(() => LineGraphComponent)}\n ]\n})\nexport class LineGraphComponent extends GraphComponent implements\n OnChanges {\n /**\n * The amount to pad the y-axis around the displayed data range. This gives\n * the data points a little cushion so that they don't run off the top or\n * bottom of the axis.\n */\n static readonly yAxisPaddingFactor = 0.25;\n static readonly NORMAL_BOUND_SERIES_NAME = 'normalBound';\n\n @Input() showTicks: boolean;\n\n private addedNormalBound = false;\n\n constructor(\n readonly sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n super.ngOnChanges(changes);\n }\n\n adjustGeneratedChartConfiguration() {\n // We have to wait until after the data loads up into the graph to iterate\n // over the points and adjust their coloring based on the normal range.\n this.addedNormalBound = this.isNormalBoundAdded(this.data.series);\n this.addYNormalRange();\n\n const seriesLength = this.data.series.length;\n\n if (this.addedNormalBound) {\n // Gives the last labeledSeries in the array a different set of\n // characteristics. The last labeledSeries depicts the normal boundary.\n const chartjsSeries = this.chartData[seriesLength - 1];\n chartjsSeries.pointStyle = 'crossRot';\n chartjsSeries.pointBorderColor = 'rgba(0,0,0,0.5)'; // medium-gray color\n chartjsSeries.pointBorderWidth = 2;\n chartjsSeries.pointRadius = 4;\n chartjsSeries.borderColor = 'transparent';\n }\n\n // Color points that fall outside of their respective normal ranges.\n // If it hasNormalBound, then the last labeledSeries does not need to\n // be styled in this for loop.\n for (let i = 0; i < (this.addedNormalBound ? seriesLength - 1 : seriesLength); i++) {\n const chartjsSeries = this.chartData[i];\n const labeledSeries = this.data.series[i];\n this.colorAbnormalPoints(chartjsSeries, labeledSeries);\n }\n if (!this.showTicks) {\n this.chartOptions.scales.yAxes[0].display = false;\n this.chartOptions.scales.yAxes[0].ticks.beginAtZero = true;\n }\n }\n\n /**\n * Adds y normal ranges to the graph and colors points the designated\n * \"abnormal\" color if they fall outside the normal range.\n */\n private addYNormalRange() {\n // Only LineGraphData has y normal bounds.\n if (!(this.data instanceof LineGraphData)) {\n return;\n }\n\n let normalRangeBounds;\n if (this.data.series.length === 1 || this.addedNormalBound) {\n // Some things are only valid if there are y-axis normal bounds. We\n // also only show normal bounds if there's one data series on the\n // axis, and all normal bounds for the current date range are the same.\n // These customizations are based on this.data, which is a type\n // specific for LineGraphData, and could not be generalized in the\n // abstract GraphCard class.\n let dateTimesInRange = [];\n let firstNormalRange: [number, number];\n if (this.data.series[0].normalRanges) {\n dateTimesInRange = Array.from(this.data.series[0].normalRanges.keys())\n .filter(date => this.dateRange.contains(date));\n firstNormalRange = dateTimesInRange.length > 0 ?\n this.data.series[0].normalRanges.get(dateTimesInRange[0]) :\n undefined;\n }\n if (firstNormalRange) {\n let differentNormalRanges = false;\n for (const time of dateTimesInRange) {\n const currNormalRange = this.data.series[0].normalRanges.get(time);\n if (currNormalRange[0] !== firstNormalRange[0] ||\n currNormalRange[1] !== firstNormalRange[1]) {\n differentNormalRanges = true;\n }\n }\n // If all normal ranges associated with points in the current date\n // range are the same, then add the region to the chart, and adjust\n // display bounds accordingly.\n if (!differentNormalRanges) {\n // To prevent the creation of multiple normal bound tooltips\n if (this.addedNormalBound === false) {\n this.createNormalBoundsTooltip(firstNormalRange);\n }\n this.addGreenRegion(firstNormalRange);\n normalRangeBounds = firstNormalRange;\n this.addedNormalBound = true;\n }\n }\n }\n this.adjustChartYScales(normalRangeBounds);\n }\n\n private adjustChartYScales(normalRangeBounds: [number, number]) {\n const yDisplayBounds = this.getDisplayBounds(normalRangeBounds);\n\n // If the display bounds are enforced and all the bounds are the\n // same, don't pad.\n const padding = (this.allBoundsAreEnforced() && this.allBoundsAreSame()) ?\n 0 :\n Math.abs(yDisplayBounds[1] - yDisplayBounds[0]) *\n LineGraphComponent.yAxisPaddingFactor;\n this.chartOptions.scales.yAxes[0].ticks.min = yDisplayBounds[0] - padding;\n this.chartOptions.scales.yAxes[0].ticks.max = yDisplayBounds[1] + padding;\n this.chartOptions.scales.yAxes[0].afterBuildTicks = (scale) => {\n if (this.data && this.data.yTicks) {\n scale.ticks =\n LineGraphData.getYTicks(yDisplayBounds[0], yDisplayBounds[1]);\n }\n };\n }\n\n /**\n * Helper function that determines whether the LabeledSeries has\n * a normal bound or not.\n * @param series LabeledSeries[] that presents the data that is to\n * be presented in the graph.\n * @returns boolean value that reflects whether there is a normal\n * bound or not.\n */\n private isNormalBoundAdded(series: LabeledSeries[]): boolean {\n for (const s of series) {\n if (s.label === LineGraphComponent.NORMAL_BOUND_SERIES_NAME) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Reconciles together several possible sources of y-axis display bounds. The\n * bounds can come from three places:\n * 1) Each ResourceCode has an expected data bound encoded.\n * 2) Each Observation point may have a normal range encoded (passed in as\n * normalRangeBounds only if all the observation points have the same\n * normal range; otherwise normalRangeBounds is undefined).\n * 3) LineGraphData tracks the range of data seen across all data points.\n *\n * Our goal here is to show as much data as possible without being misleading\n * or skewing the graph too much to include outlier points. So, we follow\n * these rules:\n *\n * 1) If all the ResourceCodes have the same expected data bound, and all of\n * them are marked to enforce that bound, choose those upper and lower\n * bounds.\n * 2) Else, consider each endpoint of the bound separately.\n * a. For the lower bound, choose min(min data, min normal bound)\n * b. For the upper bound, choose max(max data, max normal bound)\n */\n private getDisplayBounds(normalRangeBounds: [number, number]):\n [number, number] {\n if (this.allBoundsAreSame() && this.allBoundsAreEnforced()) {\n return this.data.resourceGroup.resourceCodes[0].displayBounds;\n }\n\n if (!normalRangeBounds) {\n return (this.data.yAxisDataBounds);\n }\n\n return [\n Math.min(this.data.yAxisDataBounds[0], normalRangeBounds[0]),\n Math.max(this.data.yAxisDataBounds[1], normalRangeBounds[1])\n ];\n }\n\n private allBoundsAreSame(): boolean {\n if (this.data.resourceGroup) {\n return new Set(\n this.data.resourceGroup.resourceCodes\n .map(code => code.displayBounds)\n .filter(bound => bound !== undefined)\n .map(\n bound =>\n bound.toString() // cast to string for hashability\n ))\n .size === 1;\n }\n return false;\n }\n\n private allBoundsAreEnforced(): boolean {\n if (this.data.resourceGroup) {\n return this.data.resourceGroup.resourceCodes.map(x => x.forceDisplayBounds)\n .every(x => x === true);\n }\n return false;\n }\n\n /**\n * Adds a LabeledSeries that represents the normal bounds on the y-axis\n * to the Tooltip Map.\n * @param yNormalBounds The bounds of the y range considered normal.\n */\n private createNormalBoundsTooltip(yNormalBounds: [number, number]) {\n // TypeScript requires a separate declaration for arrays of tuples.\n let coordinatesLblSeries: [DateTime, number][];\n coordinatesLblSeries = [[this.dateRange.start, yNormalBounds[0]],\n [this.dateRange.start, yNormalBounds[1]]];\n const lblSeries = new LabeledSeries(LineGraphComponent.NORMAL_BOUND_SERIES_NAME,\n coordinatesLblSeries, this.data.unit);\n\n let coordinatesChartPoint: ChartPoint[];\n coordinatesChartPoint = [{x: this.dateRange.start.toISO(), y: yNormalBounds[0]},\n {x: this.dateRange.start.toISO(), y: yNormalBounds[1]}];\n\n if (this.data) {\n this.data.series.push(lblSeries);\n\n // Creates an HTML table for the tooltip text, and adds it to the tooltip\n // map. This was done separately because not all line graphs have normal bounds\n // depicted.\n const tooltipText = '' +\n '
' +\n 'Normal Boundary
' +\n 'Upper: ' + yNormalBounds[1] + ' ' + this.data.unit + '\\n' +\n 'Lower: ' + yNormalBounds[0] + ' ' + this.data.unit +\n '
';\n\n const mapKey = this.dateRange.start.valueOf().toString();\n if (this.data.tooltipMap.has(mapKey)) {\n const value = this.data.tooltipMap.get(mapKey);\n this.data.tooltipMap.set(mapKey, value + tooltipText);\n } else {\n this.data.tooltipMap.set(mapKey, tooltipText);\n }\n }\n this.chartData.push(\n {data : coordinatesChartPoint,\n label : LineGraphComponent.NORMAL_BOUND_SERIES_NAME});\n }\n\n /**\n * Draws a green box spanning the entire x-axis and covering y axis normal\n * range. Also puts descriptive labels at the top and bottom of the range.\n * @param yNormalBounds The bounds of the y range considered normal.\n */\n private addGreenRegion(yNormalBounds: [number, number]) {\n const normalRegionAnnotation = {\n // Show the y-bounds underneath the graph points.\n drawTime: 'beforeDatasetsDraw',\n type: 'box',\n yMin: yNormalBounds[0],\n yMax: yNormalBounds[1],\n // No x-axis bounds so it extends to cover the whole graph.\n xScaleID: GraphComponent.X_AXIS_ID,\n yScaleID: GraphComponent.Y_AXIS_ID,\n // Color the region light green.\n backgroundColor: 'rgba(64, 191, 128, 0.15)',\n };\n this.chartOptions.annotation.annotations.push(normalRegionAnnotation);\n }\n\n /**\n * Colors the point the default series color if it's not abnormal, or outlines\n * with the abnormal color if marked as abnormal.\n *\n * @param series The data series to color points for.\n * @param yNormalBounds The bounds of what should be considered normal.\n * @param seriesLegend The legend info for the series we're working with.\n */\n private colorAbnormalPoints(\n chartjsSeries: any, labeledSeries: LabeledSeries) {\n const pointBackgroundColors = new Array();\n const pointBorderColors = new Array();\n const pointStyle = new Array();\n\n for (let pt of chartjsSeries.data) {\n // pt could also be a number here, so we constrain it to when it's a\n // ChartPoint. For some reason Typescript doesn't like it when we do a\n // test to see if pt is an instanceof ChartPoint so checking for the\n // y-attribute is a workaround.\n pt = pt as ChartPoint;\n const inAbnormalSet = labeledSeries.abnormalCoordinates.has(pt.x);\n\n if (inAbnormalSet) {\n pointBackgroundColors.push(\n labeledSeries.legendInfo.fill.rgb().string());\n pointBorderColors.push(ABNORMAL.rgb().string());\n pointStyle.push('triangle');\n } else {\n pointBackgroundColors.push(\n labeledSeries.legendInfo.fill.rgb().string());\n pointBorderColors.push(labeledSeries.legendInfo.outline.rgb().string());\n pointStyle.push('circle');\n }\n chartjsSeries.pointBackgroundColor = pointBackgroundColors;\n chartjsSeries.pointBorderColor = pointBorderColors;\n chartjsSeries.pointStyle = pointStyle;\n }\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, forwardRef, Inject} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {ChartPoint} from 'chart.js';\nimport {CHECK_RESULT_CODE} from 'src/app/fhir-data-classes/observation-interpretation-valueset';\nimport {LabeledSeries} from 'src/app/graphdatatypes/labeled-series';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {GraphComponent} from '../graph/graph.component';\nimport {StepGraphComponent} from '../stepgraph/stepgraph.component';\n\n@Component({\n selector: 'app-microbio-graph',\n templateUrl: '../graph/graph.component.html',\n styleUrls: ['../graph.css'],\n providers: [{\n provide: GraphComponent,\n useExisting: forwardRef(() => MicrobioGraphComponent)\n }]\n})\nexport class MicrobioGraphComponent extends StepGraphComponent {\n constructor(\n sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n }\n\n prepareForChartConfiguration() {\n super.prepareForChartConfiguration();\n // Make the points a little bigger for microbio series since there is info\n // encoded in their point styling.\n for (const series of this.chartData) {\n series.pointRadius = 5;\n series.pointBorderWidth = 2;\n }\n }\n\n adjustGeneratedChartConfiguration() {\n // Color points that fall outside of their respective normal ranges.\n for (let i = 0; i < this.data.series.length; i++) {\n const isPositive = this.data.series[i].label.includes(CHECK_RESULT_CODE);\n const chartjsSeries = this.chartData[i];\n const pointStyle = new Array();\n for (let pt of chartjsSeries.data) {\n // pt could also be a number here, so we constrain it to when it's a\n // ChartPoint. For some reason Typescript doesn't like it when we do a\n // test to see if pt is an instanceof ChartPoint so checking for the\n // y-attribute is a workaround.\n pt = pt as ChartPoint;\n if (isPositive) {\n pointStyle.push('triangle');\n } else {\n pointStyle.push('circle');\n }\n (chartjsSeries as any).pointStyle = pointStyle;\n }\n }\n }\n\n /***************************\n * Legend interactions\n * Because of the unique nature of the series in the MicrobioGraph, we do not\n * allow legend interactions for microbiology graphs. This prevents errors\n * that occur when the user hovers over a legend element that might correspond\n * to many series on the chart.\n */\n\n /**\n * @override\n */\n resetChart() {}\n\n /**\n * @override\n */\n focusOnSeries(labeledSeries: LabeledSeries[]) {}\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, forwardRef, Inject} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {GraphComponent} from '../graph/graph.component';\nimport {LineGraphComponent} from '../linegraph/linegraph.component';\n\n@Component({\n selector: 'app-scatterplot',\n templateUrl: '../graph/graph.component.html',\n styleUrls: ['../graph.css'],\n providers: [{\n provide: GraphComponent,\n useExisting: forwardRef(() => ScatterplotComponent)\n }]\n})\nexport class ScatterplotComponent extends LineGraphComponent {\n constructor(\n sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n this.chartTypeString = 'scatter';\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, forwardRef, Inject} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {MicrobioGraphData} from 'src/app/graphdatatypes/microbiographdata';\nimport {UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {StepGraphData} from '../../graphdatatypes/stepgraphdata';\nimport {GraphComponent} from '../graph/graph.component';\n\n@Component({\n selector: 'app-stepgraph',\n templateUrl: '../graph/graph.component.html',\n styleUrls: ['../graph.css'],\n providers: [\n {provide: GraphComponent, useExisting: forwardRef(() => StepGraphComponent)}\n ]\n})\nexport class StepGraphComponent extends\n GraphComponent {\n constructor(\n readonly sanitizer: DomSanitizer,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n super(sanitizer, uiConstants);\n }\n /**\n * The maximum characters for a y-axis tick label.\n */\n readonly Y_AXIS_TICK_MAX_LENGTH = 12;\n\n /**\n * Adjusts the y-axis configuration for the chart.\n */\n prepareForChartConfiguration() {\n this.chartOptions.scales.yAxes[0].type = 'category';\n this.chartOptions.scales.yAxes[0].gridLines = {\n display: true,\n drawOnChartArea: true\n };\n\n // Set up the data points.\n const yValuesForEndpoints = [];\n for (const series of this.data.series) {\n // Since the categorical labels may be long, we truncate the label names.\n // We also have to re-map the coordinates to the truncated names so\n // that they may be plotted correctly along the categorical axis.\n series.coordinates.forEach(pt => {\n const lbl = pt[1] as string;\n const truncatedLabel = lbl.substr(0, this.Y_AXIS_TICK_MAX_LENGTH) +\n (lbl.length > this.Y_AXIS_TICK_MAX_LENGTH ? '...' : '');\n yValuesForEndpoints.push(truncatedLabel);\n pt[1] = truncatedLabel;\n });\n }\n let allLabels = Array.from(new Set(yValuesForEndpoints));\n // Show the labels alphabetically along the y-axis.\n allLabels = allLabels.sort();\n // Add blank labels to the top and bottom of the graph to add some padding.\n allLabels.push('\\t');\n allLabels.unshift('\\t');\n\n this.chartOptions.scales.yAxes[0]['labels'] = allLabels;\n }\n adjustGeneratedChartConfiguration() {}\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport {Duration} from 'luxon';\nimport {AnnotatedAdministration, MedicationAdministration} from 'src/app/fhir-data-classes/medication-administration';\n\nimport {MedicationOrder} from '../../fhir-data-classes/medication-order';\nimport {Tooltip} from '../tooltips/tooltip';\n\n/**\n * Makes a tooltip for a medication order that lists the order's first and last\n * doses in a table.\n */\nexport class MedicationTooltip extends Tooltip {\n getTooltip(order: MedicationOrder, sanitizer: DomSanitizer): string {\n const medication = order.label;\n const firstDose =\n Tooltip.formatTimestamp(order.firstAdministration.timestamp);\n const lastDose =\n Tooltip.formatTimestamp(order.lastAdmininistration.timestamp);\n const dosageInstruction = order.dosageInstruction;\n const table = Tooltip.createNewTable();\n Tooltip.addHeader(medication, table, sanitizer);\n Tooltip.addRow(table, ['First Dose', firstDose], sanitizer);\n Tooltip.addRow(table, ['Last Dose', lastDose], sanitizer);\n Tooltip.addRow(\n table, ['Dosage Instructions', dosageInstruction], sanitizer);\n return table.outerHTML;\n }\n}\n\n/**\n * Makes a tooltip for a medication administration that shows its dose\n * as well as the time since the last dose.\n */\nexport class MedicationAdministrationTooltip extends\n Tooltip {\n getTooltip(\n administrations: AnnotatedAdministration[],\n sanitizer: DomSanitizer): string {\n const timestamp = administrations[0].medAdministration.timestamp;\n const table = Tooltip.createNewTable();\n for (const administration of administrations) {\n Tooltip.addHeader(\n Tooltip.formatTimestamp(timestamp) + ': Dose ' +\n administration.doseInOrder + ' of ' +\n administration.medAdministration.rxNormCode.label,\n table, sanitizer, 3);\n Tooltip.addRow(table, ['', 'Time', 'Dose'], sanitizer);\n Tooltip.addRow(\n table,\n [\n 'This dose',\n Tooltip.formatTimestamp(administration.medAdministration.timestamp),\n this.formatDosage(administration.medAdministration)\n ],\n sanitizer);\n\n if (administration.previousDose) {\n const timestampDifference: Duration =\n administration.medAdministration.timestamp.diff(\n administration.previousDose.medAdministration.timestamp);\n\n const doseDiffText =\n Tooltip.formatTimestamp(\n administration.previousDose.medAdministration.timestamp) +\n '
(' + timestampDifference.toFormat('h:m') + ' after dose ' +\n administration.previousDose.doseInOrder + ')';\n\n Tooltip.addRow(\n table,\n [\n 'Previous dose', doseDiffText,\n this.formatDosage(administration.previousDose.medAdministration)\n ],\n sanitizer);\n }\n }\n return table.outerHTML;\n }\n\n private formatDosage(administration: MedicationAdministration) {\n return administration.dosage.quantity.toLocaleString() + ' ' +\n administration.dosage.unit;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport * as Color from 'color';\n\nimport {AnnotatedDiagnosticReport} from 'src/app/fhir-data-classes/annotated-diagnotic-report';\nimport {DiagnosticReportStatus} from 'src/app/fhir-data-classes/diagnostic-report';\n\nimport {Tooltip} from '../tooltips/tooltip';\n\n/*\n * This class makes a tooltip for a DiagnosticReport that applies to all points\n * charted from the same report. It lists the time of the report, the report\n * status, as well as all results contained in the report.\n */\nexport class MicrobioTooltip extends Tooltip {\n constructor(private addTimestampRow = true, private color?: Color) {\n super();\n }\n\n getTooltip(\n annotatedReport: AnnotatedDiagnosticReport, sanitizer: DomSanitizer,\n isAbnormal: boolean = false): string {\n const status = DiagnosticReportStatus[annotatedReport.report.status];\n const results = annotatedReport.report.results;\n const timestamp = annotatedReport.timestamp;\n const specimen = annotatedReport.report.specimen.type;\n\n const table = Tooltip.createNewTable();\n if (this.addTimestampRow) {\n Tooltip.addTimeHeader(timestamp, table, sanitizer);\n }\n\n Tooltip.addHeader('Result set', table, sanitizer);\n\n for (const result of results) {\n Tooltip.addRow(\n table, [result.display, result.interpretation.display], sanitizer,\n this.color, isAbnormal);\n }\n Tooltip.addRow(table, ['Status', status], sanitizer);\n Tooltip.addRow(table, ['Specimen', specimen], sanitizer);\n\n return table.outerHTML;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {DomSanitizer} from '@angular/platform-browser';\nimport * as Color from 'color';\nimport {DateTime} from 'luxon';\nimport {AnnotatedObservation} from 'src/app/fhir-data-classes/annotated-observation';\nimport {NORMAL} from 'src/app/fhir-data-classes/observation-interpretation-valueset';\n\nimport {Observation} from '../../fhir-data-classes/observation';\n\nimport {Tooltip} from './tooltip';\n\n/*\n * This class makes a tooltip for a list of Observations containing discrete, or\n * qualitative, values rather than quantitative results. The list of\n * Observations should all have the same timestamp.\n */\nexport class DiscreteObservationTooltip extends Tooltip {\n constructor(private addTimestampRow = true) {\n super();\n }\n\n /**\n * Returns the HTML for a generic tooltip for discrete observations.\n * @param observations An array of type Observation\n * @param sanitizer A DOM sanitizer\n * @param isAbnormal A boolean used to change the color of the text if abnormal\n * @returns A string representing the HTML table.\n */\n getTooltip(observations: Observation[], sanitizer: DomSanitizer): string {\n const table = Tooltip.createNewTable();\n if (this.addTimestampRow) {\n Tooltip.addTimeHeader(observations[0].timestamp, table, sanitizer);\n }\n for (const obs of observations) {\n let isAbnormal = false;\n let obsValue = obs.result;\n if (obs.interpretation && obs.interpretation.code !== NORMAL) {\n isAbnormal = true;\n obsValue = obs.result + ' (' + obs.interpretation.display + ')';\n }\n Tooltip.addRow(table,\n [obs.label, obsValue], sanitizer,\n undefined, // color\n isAbnormal);\n }\n return table.outerHTML;\n }\n}\n\n/**\n * Makes a generic tooltip for an AnnotatedObservation with rows for each of\n * its annotation values.\n */\nexport class GenericAnnotatedObservationTooltip extends\n Tooltip {\n constructor(private addTimestampRow: boolean, private color: Color) {\n super();\n }\n\n /**\n * Returns the HTML for a generic tooltip.\n * @param observation The AnnotatedObservation used to generate the tooltip\n * @param sanitizer A DOM sanitizer\n * @param isAbnormal A boolean used to change the color of the text if abnormal\n * @returns If the observation has annotations, a HTML table with the\n * annotation values. If there are no annotations, will return undefined.\n */\n getTooltip(observation: AnnotatedObservation, sanitizer: DomSanitizer, isAbnormal: boolean = false): string\n |undefined {\n const table = Tooltip.createNewTable();\n if (this.addTimestampRow) {\n Tooltip.addTimeHeader(\n observation.observation.timestamp, table, sanitizer);\n }\n\n Tooltip.addRow(\n table,\n [\n observation.label,\n this.getObservationValue(observation)\n ],\n sanitizer, this.color, isAbnormal);\n for (const annotation of observation.annotationValues) {\n Tooltip.addRow(table, annotation, sanitizer);\n }\n return table.outerHTML;\n }\n /**\n * Helper function that returns a string that reflects the observation\n * value depicted on the tooltip.\n * @param observation The AnnotatedObservation used to generate the tooltip\n */\n\n private getObservationValue(observation: AnnotatedObservation): string {\n const interpretation = observation.observation.interpretation ?\n ' (' + observation.observation.interpretation.display + ')' :\n '';\n // Example: Temperature | 38.8 Deg C (HI)\n if (observation.observation.value && observation.observation.unit) {\n return observation.observation.value.value.toString() + ' ' +\n observation.observation.unit + interpretation;\n }\n // Example: Bacteria Urinalysis | Trace Graded/hpf (ABN)\n if (observation.observation.result) {\n return observation.observation.result + interpretation;\n }\n // Example: Blood Pressure | (HI)\n return interpretation;\n }\n}\n\n/**\n * Makes a generic tooltip for an AnnotatedObservation with rows for each of\n * its annotation values.\n */\nexport class GenericAbnormalTooltip extends\n Tooltip<{[key: string]: number | string}> {\n constructor(private addTimestampRow: boolean, private color: Color) {\n super();\n }\n\n /**\n * Returns the HTML for a generic tooltip.\n * @param params The parameters necessary for the AbnormalTooltip text. It\n * should contain a timestamp field, a value field, a label field, and a\n * unit field.\n * @param sanitizer A DOM sanitizer\n * @returns If the observation has annotations, a HTML table with the\n * annotation values. If there are no annotations, will return undefined.\n */\n getTooltip(params: {[key: string]: number|string}, sanitizer: DomSanitizer):\n string|undefined {\n const table = Tooltip.createNewTable();\n const millis: any = params['timestamp'];\n const timestamp = DateTime.fromMillis(millis).toLocal();\n if (this.addTimestampRow) {\n Tooltip.addTimeHeader(timestamp, table, sanitizer);\n }\n\n Tooltip.addHeader('Caution: abnormal value', table, sanitizer);\n return table.outerHTML;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {SecurityContext} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\nimport * as Color from 'color';\nimport * as Colors from '../../theme/verily_colors';\nimport {DateTime} from 'luxon';\n\n/*\n * This base class contains useful helper methods used while making a custom\n * tooltip for a c3 chart, including adding a row to the table, resetting the\n * table, and adding a header.\n *\n * This is functionally a static class, but Typescript doesn't allow for\n * abstract static functions. We make all tooltip classes inherit from Tooltip\n * so that they must implement the getTooltip function.\n *\n * @param T The type of data that the tooltip is derived from.\n */\nexport abstract class Tooltip {\n /**CSS styling for normal tooltip circular color swatch */\n static readonly TOOLTIP_NORMAL_CSS = 'display: inline-block; height: 10px; width: 10px; ' +\n 'margin-right: 6px; border-radius: 50%;';\n /**CSS styling for abnormal tooltip triangular color swatch */\n static readonly TOOLTIP_ABNORMAL_CSS = 'width: 0; display:inline-block; margin-right: 6px; ' +\n 'height: 0; border-left: 6px solid transparent; ' +\n 'border-right: 6px solid transparent; border-bottom: ' +\n '6px solid ';\n\n /**\n * Creates a new table for the tooltip. Returns a HTMLTableElement.\n */\n static createNewTable(): HTMLTableElement {\n const table: HTMLTableElement = document.createElement('table');\n table.setAttribute('class', 'c3-tooltip');\n return table;\n }\n\n /**\n * Adds a header on the tooltips depicting the timepoint of the data\n * @param timestamp DateTime reflecting the datapoint depicted on the tooltip\n * @param table HTMLTableElement on the tooltip that needs to be edited\n * @param sanitizer A DOM sanitizer\n * @param colSpan The number of columns that the header spans\n */\n static addTimeHeader(\n timestamp: DateTime, table: HTMLTableElement, sanitizer: DomSanitizer,\n colSpan = 2) {\n Tooltip.addHeader(\n Tooltip.formatTimestamp(timestamp), table, sanitizer, colSpan);\n }\n\n /**\n * Returns a string of the timestamp in format: MM/DD/YYYY HH:MM\n * @param timestamp DateTime reflecting the datapoint depicted on the tooltip\n */\n static formatTimestamp(timestamp: DateTime) {\n return timestamp.toLocal().toLocaleString() + ' ' +\n timestamp.toLocal().toLocaleString(DateTime.TIME_24_SIMPLE);\n }\n\n /**\n * Adds a header to the HTMLTableElement\n * @param content String reflecting content inside the header\n * @param table HTMLTableElement on the tooltip that needs to be edited\n * @param sanitizer A DOM sanitizer\n * @param colSpan The number of columns that the header spans\n */\n static addHeader(\n content: string, table: HTMLTableElement, sanitizer: DomSanitizer,\n colSpan = 2) {\n // Header row\n const row = table.insertRow();\n const headerCell = document.createElement('th');\n row.appendChild(headerCell);\n headerCell.colSpan = colSpan;\n headerCell.innerHTML = sanitizer.sanitize(SecurityContext.HTML, content);\n }\n\n /**\n * Adds row to the HTMLTableElement\n * @param table HTMLTableElement on the tooltip that needs to be edited\n * @param cellText String array reflecting the content on the tooltip\n * @param sanitizer A DOM sanitizer\n * @param color Color that is displayed on the legend and the graph.\n * @param isAbnormal Boolean that depicts whether the datapoint is abnormal\n */\n static addRow(\n table: HTMLTableElement, cellText: string[], sanitizer: DomSanitizer,\n color?: Color, isAbnormal?: boolean) {\n const row = table.insertRow();\n for (let i = 0; i < cellText.length; i++) {\n const cell1 = row.insertCell();\n if (i === 0) {\n cell1.className = 'name';\n if (isAbnormal) {\n cell1.setAttribute('style', 'color: ' + Colors.ABNORMAL);\n }\n if (color) {\n cell1.appendChild(Tooltip.makeColorSwatch(color, isAbnormal));\n const div = document.createElement('div');\n div.setAttribute('style', 'display: inline-block;');\n div.innerHTML = sanitizer.sanitize(SecurityContext.HTML, cellText[i]);\n cell1.appendChild(div);\n continue;\n }\n } else {\n cell1.className = 'value';\n if (isAbnormal) {\n cell1.setAttribute('style', 'color: ' + Colors.ABNORMAL);\n }\n }\n cell1.innerHTML = sanitizer.sanitize(SecurityContext.HTML, cellText[i]);\n }\n }\n\n /**\n * Helper function that creates the color swatch on the tooltips. If it\n * is regular, it is rectangular. If it is abnormal, it is triangular.\n * @param color Color that is displayed on the legend and the graph.\n * @param isAbnormal Boolean that depicts whether the datapoint is abnormal\n */\n static makeColorSwatch(color: Color, isAbnormal: boolean = false): HTMLSpanElement {\n const colorSpan: HTMLSpanElement = document.createElement('span');\n if (isAbnormal) {\n // Creates a triangular color swatch\n colorSpan.setAttribute(\n 'style',\n this.TOOLTIP_ABNORMAL_CSS + color.toString());\n } else {\n // Creates a circular color swatch\n colorSpan.setAttribute(\n 'style',\n 'background-color: ' + color.toString() + '; ' + this.TOOLTIP_NORMAL_CSS);\n }\n return colorSpan;\n }\n\n abstract getTooltip(inputValue: T, sanitizer: DomSanitizer): string;\n}\n\n/**\n * This is a generic tooltip for a data point on the graph. It just takes in\n * the data points C3 provides to the tooltip function, then returns a table\n * with a header of the timestamp and a row for each included point.\n * The left hand side of each row is the series label. The right hand side of\n * each row is the y-value.\n */\nexport class StandardTooltip extends Tooltip {\n constructor(\n private dataPoints: any[], private color: Function, private unit = '') {\n super();\n }\n\n getTooltip(unused: any, sanitizer: DomSanitizer): string {\n const table = Tooltip.createNewTable();\n Tooltip.addTimeHeader(\n DateTime.fromJSDate(new Date(this.dataPoints[0].x)), table, sanitizer);\n\n for (const pt of this.dataPoints) {\n Tooltip.addRow(\n table, [pt.name, pt.value + ' ' + this.unit], sanitizer,\n this.color(pt));\n }\n return table.outerHTML;\n }\n}\n","module.exports = \".stepContent {\\n margin-bottom: 30px;\\n margin-top: 10px;\\n font-size: 20px;\\n}\\n\\n::ng-deep .mat-horizontal-content-container {\\n padding-bottom: 0px !important;\\n}\\n\\n.stepperButtons {\\n float: right;\\n}\\n\\n.stepperButtons button {\\n margin-right: 5px;\\n}\\n\\n::ng-deep .mat-dialog-container {\\n max-height: 500px !important;\\n}\\n\\nimg {\\n max-width: 100%;\\n}\\n\\n.divider {\\n margin-bottom: 20px;\\n margin-top: 10px;\\n border-top-width: 5px !important;\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvaGVscC1kaWFsb2cvaGVscC1kaWFsb2cuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLG1CQUFtQjtFQUNuQixnQkFBZ0I7RUFDaEIsZUFBZTtBQUNqQjs7QUFFQTtFQUNFLDhCQUE4QjtBQUNoQzs7QUFFQTtFQUNFLFlBQVk7QUFDZDs7QUFFQTtFQUNFLGlCQUFpQjtBQUNuQjs7QUFFQTtFQUNFLDRCQUE0QjtBQUM5Qjs7QUFFQTtFQUNFLGVBQWU7QUFDakI7O0FBRUE7RUFDRSxtQkFBbUI7RUFDbkIsZ0JBQWdCO0VBQ2hCLGdDQUFnQztBQUNsQyIsImZpbGUiOiJzcmMvYXBwL2hlbHAtZGlhbG9nL2hlbHAtZGlhbG9nLmNvbXBvbmVudC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuc3RlcENvbnRlbnQge1xuICBtYXJnaW4tYm90dG9tOiAzMHB4O1xuICBtYXJnaW4tdG9wOiAxMHB4O1xuICBmb250LXNpemU6IDIwcHg7XG59XG5cbjo6bmctZGVlcCAubWF0LWhvcml6b250YWwtY29udGVudC1jb250YWluZXIge1xuICBwYWRkaW5nLWJvdHRvbTogMHB4ICFpbXBvcnRhbnQ7XG59XG5cbi5zdGVwcGVyQnV0dG9ucyB7XG4gIGZsb2F0OiByaWdodDtcbn1cblxuLnN0ZXBwZXJCdXR0b25zIGJ1dHRvbiB7XG4gIG1hcmdpbi1yaWdodDogNXB4O1xufVxuXG46Om5nLWRlZXAgLm1hdC1kaWFsb2ctY29udGFpbmVyIHtcbiAgbWF4LWhlaWdodDogNTAwcHggIWltcG9ydGFudDtcbn1cblxuaW1nIHtcbiAgbWF4LXdpZHRoOiAxMDAlO1xufVxuXG4uZGl2aWRlciB7XG4gIG1hcmdpbi1ib3R0b206IDIwcHg7XG4gIG1hcmdpbi10b3A6IDEwcHg7XG4gIGJvcmRlci10b3Atd2lkdGg6IDVweCAhaW1wb3J0YW50O1xufSJdfQ== */\"","module.exports = \"
\\n \\n
\\n\\n \\n \\n {{index +1}}\\n \\n \\n
\\n
\\n MedTimeLine Configuration Screen\\n
\\n \\n
\\n
\\n \\n
\\n
\\n\\n \\n
\\n
\\n
\\n Click on the current date range to open the datepicker.\\n
\\n \\n
\\n \\n
\\n
\\n Choose a patient encounter or pre-set time period on the left.\\n
\\n \\n
\\n \\n
\\n
\\n Alternatively, choose a custom date range.\\n
\\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n\\n \\n
\\n
\\n The Custom Timeline feature allows you to enter custom events.\\n
\\n
\\n
\\n Click the pencil icon to enter edit mode.\\n
\\n \\n
\\n \\n
\\n
\\n Click the timeline at a place where you would like to add a flag.\\n
\\n \\n
\\n \\n
\\n
\\n In the dialog box, enter a title, description, and select a color for the flag.\\n
\\n \\n
\\n \\n
\\n
\\n You can also manually adjust the date and/or time.\\n
\\n
\\n While in edit mode, you can edit an existing flag, which will open up the dialog box again.\\n
\\n \\n
\\n \\n
\\n
\\n You can also remove flags while in edit mode.\\n
\\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n\\n \\n
\\n
\\n You can enter notes in the main timeline display area.\\n
\\n
\\n
\\n Click the pencil icon to enter edit mode.\\n
\\n \\n
\\n \\n
\\n
\\n Type in your notes, and click the save button to save the note.\\n
\\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n\\n \\n
\\n
\\n You can add, remove, and rearrange timelines to optimize the data view for specific patients.\\n
\\n
\\n
\\n To add a timeline, click the plus sign, then select Add Data Timeline.\\n Select the timeline type you want to add, then select the specific timeline.\\n
\\n \\n
\\n \\n
\\n You can also add another Custom Timeline or text notes. You can also search for concept through the autocomplete\\n input.\\n
\\n \\n \\n
\\n To remove a timeline, hover your cursor over the timeline you want to remove. Click the X in the upper left\\n corner of the timeline.\\n
\\n \\n \\n
\\n You can undo a deletion of a card, as well.\\n
\\n \\n \\n
\\n To rearrange timelines, click the label or colored handle on the left hand side of the timeline you want to\\n move, and hold the mouse button and drag and drop the timeline to your desired location.\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n\\n \\n
\\n
\\n Timelines are categorized and color-coded by a vertical bar on the leftmost side of the data timeline.\\n
\\n
\\n
\\n You can hover over plotted data point and additional data displays in a tooltip.\\n
\\n \\n \\n \\n
\\n \\n
\\n
\\n \\n \\n
\\n
\\n
\"","import {Component} from '@angular/core';\nimport {MatDialogRef} from '@angular/material';\n\n\n/**\n * This class holds the logic and template for a tutorial stepper dialog.\n */\n@Component({\n selector: 'app-help-dialog',\n templateUrl: './help-dialog.component.html',\n styleUrls: ['./help-dialog.component.css']\n})\nexport class HelpDialogComponent {\n constructor(public dialogRef: MatDialogRef) {}\n\n onExit() {\n this.dialogRef.close();\n }\n}\n","module.exports = \"::ng-deep .ifuViewer {\\n height: 300px;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvaWZ1LWRpYWxvZy9pZnUtZGlhbG9nLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxhQUFhO0FBQ2YiLCJmaWxlIjoic3JjL2FwcC9pZnUtZGlhbG9nL2lmdS1kaWFsb2cuY29tcG9uZW50LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIjo6bmctZGVlcCAuaWZ1Vmlld2VyIHtcbiAgaGVpZ2h0OiAzMDBweDtcbn1cbiJdfQ== */\"","module.exports = \"

MedTimeLine Instructions For Use

\\n
\\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component} from '@angular/core';\nimport {MatDialogRef} from '@angular/material';\n\n@Component({\n selector: 'app-ifu-dialog',\n templateUrl: './ifu-dialog.component.html',\n styleUrls: ['./ifu-dialog.component.css']\n})\nexport class IfuDialogComponent {\n constructor(public dialogRef: MatDialogRef) {}\n\n onExit() {\n this.dialogRef.close();\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {HttpClient} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {DateTime, Interval} from 'luxon';\nimport {FhirResourceType} from 'src/constants';\nimport {v4 as uuid} from 'uuid';\n\nimport {environment} from '../environments/environment';\n\nimport {BCHMicrobioCodeGroup} from './clinicalconcepts/bch-microbio-code';\nimport {LOINCCode} from './clinicalconcepts/loinc-code';\nimport {ResourceCode} from './clinicalconcepts/resource-code-group';\nimport {RxNormCode} from './clinicalconcepts/rx-norm';\nimport {DiagnosticReport} from './fhir-data-classes/diagnostic-report';\nimport {Encounter} from './fhir-data-classes/encounter';\nimport {MedicationAdministration} from './fhir-data-classes/medication-administration';\nimport {MedicationOrder} from './fhir-data-classes/medication-order';\nimport {Observation, ObservationStatus} from './fhir-data-classes/observation';\nimport {FhirService} from './fhir.service';\n\n@Injectable()\nexport class MockFhirService extends FhirService {\n private readonly assetPath = './assets/' + environment.mockDataFolder + '/';\n private readonly allFilePaths =\n environment.mockDataFiles.map(x => this.assetPath + x + '.json');\n\n private readonly loincMap = new Map();\n private readonly medicationAdministrationMapByCode =\n new Map();\n private readonly medicationAdministrationMapByOrderId =\n new Map();\n private readonly medicationOrderMap = new Map();\n private readonly encounters = new Array();\n private readonly allDataPromise: Promise;\n private microbioJson: JSON;\n\n private constructResourceMap(\n json: any, mapToUpdate: Map, constructorFn: (any) => V,\n getCodesFn: (value: V) => K[]) {\n try {\n const obj = constructorFn(json.resource);\n const uniqueCodes = Array.from(new Set(getCodesFn(obj)));\n for (const code of uniqueCodes) {\n let existing = mapToUpdate.get(code);\n if (!existing) {\n existing = [];\n }\n existing.push(obj);\n mapToUpdate.set(code, existing);\n }\n } catch (err) {\n // tslint:disable-next-line:no-console\n console.debug(err);\n }\n }\n\n private mapAllData(): Promise {\n return Promise.all(this.allFilePaths.map(filePath => {\n return this.http.get(filePath).toPromise().then(data => {\n if (filePath.includes('_MB_data')) {\n this.microbioJson = data;\n }\n try {\n let entry = data.entry;\n // Sometimes data comes to us in bundles, and then we want to flatten\n // it into a series of resources.\n if (data.length > 0) {\n entry = data.map(bundle => bundle.entry).flat();\n }\n for (const json of entry) {\n const mockRequestId = uuid();\n const resourceType = json.resource.resourceType;\n if (resourceType === FhirResourceType.Observation) {\n this.constructResourceMap(\n json, this.loincMap,\n (x: any) => new Observation(x, mockRequestId),\n (obs) => obs.codes);\n }\n\n if (resourceType === FhirResourceType.MedicationAdministration) {\n this.constructResourceMap(\n json, this.medicationAdministrationMapByCode,\n (d) => new MedicationAdministration(d, mockRequestId),\n (admin) => [admin.rxNormCode]);\n\n this.constructResourceMap(\n json, this.medicationAdministrationMapByOrderId,\n (d) => new MedicationAdministration(d, mockRequestId),\n (admin) => [admin.medicationOrderId]);\n }\n\n if (resourceType === FhirResourceType.MedicationOrder) {\n this.constructResourceMap(\n json, this.medicationOrderMap,\n (d) => new MedicationOrder(d, mockRequestId),\n (order) => [order.orderId]);\n }\n\n if (resourceType === FhirResourceType.Encounter) {\n const encounter = new Encounter(json.resource, mockRequestId);\n this.encounters.push(encounter);\n }\n }\n } catch {\n console.warn(\n 'Trouble reading file: ' + filePath +\n '. Continuing on since this is the mock server.');\n }\n });\n }));\n }\n\n constructor(private http: HttpClient) {\n super();\n this.allDataPromise = this.mapAllData();\n }\n\n /**\n * Gets observations from a specified date range with a specific LOINC code.\n * @param code The LOINC code for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount If set, the number of observations that should be\n * queried for\n */\n getObservationsWithCode(\n code: LOINCCode,\n dateRange: Interval,\n ): Promise {\n return this.allDataPromise.then(\n map => this.getObservations(this.loincMap, code, dateRange));\n }\n\n private getObservations(\n map: Map, code: LOINCCode,\n dateRange: Interval) {\n return map.has(code) ?\n map.get(code)\n .filter(obs => dateRange.contains(obs.timestamp))\n .filter(obs => obs.status !== ObservationStatus.EnteredInError) :\n [];\n }\n\n observationsPresentWithCode(code: LOINCCode, dateRange: Interval):\n Promise {\n return this.getObservationsWithCode(code, dateRange)\n .then(results => results.length > 0);\n }\n\n /**\n * Gets medication data from a specified date range with a specific Rx code\n * @param code The RxNormCode codes for which to get observations.\n * @param dateRange The time interval observations should fall between.\n * @param limitCount Unused in this implementation, as this is just a\n * time-saving feature for HTTP calls.\n */\n getMedicationAdministrationsWithCode(\n code: RxNormCode, dateRange: Interval,\n limitCount?: number): Promise {\n return this.allDataPromise.then(x => {\n return this.medicationAdministrationMapByCode.has(code) ?\n this.medicationAdministrationMapByCode.get(code)\n .filter(obs => dateRange.contains(obs.timestamp))\n .slice(0, limitCount ? limitCount : undefined) :\n [];\n });\n }\n\n medicationsPresentWithCode(code: RxNormCode, dateRange: Interval):\n Promise {\n return this.getMedicationAdministrationsWithCode(code, dateRange)\n .then(obs => obs.length > 0, rejection => {\n // If any MedicationAdministration for this code results in an error,\n // do not show any MedicationAdministrations at all.\n throw rejection;\n });\n }\n\n /**\n * Returns arbitrary orders for current mock medications.\n * @param id The id to pull the order from.\n */\n getMedicationOrderWithId(id: string): Promise {\n return this.allDataPromise.then(\n x => this.medicationOrderMap.has(id) ?\n this.medicationOrderMap.get(id)[0] :\n undefined);\n }\n\n /**\n * Gets administrations for specified order id.\n * @param id The id to pull the order from.\n */\n getMedicationAdministrationsWithOrder(id: string, code: RxNormCode):\n Promise {\n return this.allDataPromise.then(\n x => this.medicationAdministrationMapByOrderId.get(id));\n }\n\n /**\n * Gets the encounters for the patient for any encounter that falls in the\n * given date range.\n * @param dateRange Return all encounters that covered any time in this\n * date range.\n */\n getEncountersForPatient(dateRange: Interval): Promise {\n return this.allDataPromise.then(\n x => this.encounters.filter(\n encounter => dateRange.intersection(encounter.period) !== null &&\n encounter.period.start >= DateTime.utc().minus({years: 1})));\n }\n\n /**\n * Prints the current HTML of the graphs rendered to the console.\n * @param html The inner HTML to keep in the Document.\n * @param date The date the note was written for.\n */\n saveStaticNote(image: HTMLCanvasElement, date: string): Promise {\n console.log('Save to note button clicked for mock data for date: ' + date);\n console.log(image);\n return Promise.resolve(true);\n }\n\n /**\n * Gets the DiagnosticReports for the patient for any report that falls in\n * the given date range, whose contained Observations are in the codeGroup\n * provided.\n * @param codeGroup The CodeGroup to retrieve DiagnosticReports for.\n * @param dateRange Return all DiagnosticReports that covered any time in\n * this date range.\n */\n getDiagnosticReports(\n codeGroup: BCHMicrobioCodeGroup, dateRange: Interval,\n limitCount?: number): Promise {\n return this.allDataPromise.then(x => {\n return DiagnosticReport.parseAndFilterMicrobioData(\n this.microbioJson, codeGroup);\n });\n }\n}\n","/**\n * Error class for errors with request IDs.\n * Formats the error message with the list of request IDs, the message,\n * and optional json.\n */\nexport class ResultError extends Error {\n readonly shortMessage;\n\n constructor(requestIds: Set, message: string, json?: any) {\n const requestIDMessage = requestIds.size > 0 ?\n `Request IDs: ${Array.from(requestIds).join(', ')}.\\n` :\n '';\n const shortMessage = requestIDMessage + message;\n let completeMessage = shortMessage;\n if (json) {\n completeMessage += `\\nJSON: ${JSON.stringify(json, null, 4)}`;\n }\n super(completeMessage);\n // 'super' needs to be called before accessing 'this', so we need to set\n // this.shortMessage after calling 'super'.\n this.shortMessage = shortMessage;\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Injectable} from '@angular/core';\nimport {Interval} from 'luxon';\n\nimport {Encounter} from './fhir-data-classes/encounter';\nimport {AxisGroup} from './graphtypes/axis-group';\nimport {ResultError} from './result-error';\n\n/**\n * This class is a service that communicates the user-selected concepts on the\n * configuration page (SetupComponent) to CardContainerComponent.\n */\n@Injectable({providedIn: 'root'})\nexport class SetupDataService {\n /** Which concepts to display. */\n selectedConcepts: AxisGroup[];\n /** Which encounters to show in the date picker. */\n encounters: Encounter[];\n encountersError?: ResultError;\n /**\n * The first date range to load into the app.\n */\n selectedDateRange: Interval;\n}\n","module.exports = \"button {\\n margin-right: 10px;\\n}\\n\\nh3 {\\n padding: 5px;\\n margin: 10px;\\n}\\n\\nh1, h2 {\\n font-family: 'Montserrat', sans-serif;\\n}\\n\\n.search-icon {\\n padding-top: 20px;\\n vertical-align: bottom;\\n}\\n\\n.actions {\\n margin-left: auto;\\n padding: 20px;\\n}\\n\\n.category {\\n padding-left: 10px;\\n}\\n\\n.mainSetup {\\n width: 100%;\\n padding-top: 20px;\\n padding-left: 40px;\\n color: white;\\n height: 100%;\\n}\\n\\n.conceptOptions {\\n padding-left: 25px;\\n}\\n\\n::ng-deep .mat-toolbar-row, .mat-toolbar-single-row {\\n display: -webkit-box;\\n display: flex;\\n display: -ms-flexbox;\\n}\\n\\n.defaultBackgroundColor {\\n background-color: #202020; /* Grey 900 */\\n}\\n\\n.accentBackgroundColor {\\n /* Deep Purple 800 to Pink 900 */\\n background-image: -webkit-gradient(linear, left top, right top, from(#4527A0) , to(#870D4E));\\n background-image: linear-gradient(to right, #4527A0 , #870D4E);\\n color: white;\\n}\\n\\n::ng-deep app-setup .mat-form-field-wrapper {\\n color: white;\\n}\\n\\n::ng-deep app-setup .mat-checkbox-frame {\\n border-color: white;\\n}\\n\\n::ng-deep app-setup .mat-radio-outer-circle {\\n border-color: white;\\n}\\n\\n::ng-deep app-setup .mat-checkbox-disabled .mat-checkbox-label {\\n color: gray;\\n}\\n\\n::ng-deep app-setup .mat-form-field-empty.mat-form-field-label {\\n color: white;\\n}\\n\\n::ng-deep app-setup .mat-form-field-label {\\n color:white !important;\\n}\\n\\n::ng-deep app-setup .mat-form-field-underline {\\n background-color: white !important;\\n}\\n\\n::ng-deep app-setup .mat-form-field.mat-focused .mat-form-field-ripple {\\n background-color: white !important;\\n}\\n\\n::ng-deep app-setup .mat-form-field-underline {\\n background-color: white !important;\\n}\\n\\napp-setup .mat-input-placeholder {\\n color: white;\\n}\\n\\n.encounters-error {\\n width: 50%;\\n margin-bottom: 16px;\\n white-space: pre-wrap;\\n word-break: break-all;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvc2V0dXAvc2V0dXAuY29tcG9uZW50LmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLFlBQVk7RUFDWixZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxxQ0FBcUM7QUFDdkM7O0FBRUE7RUFDRSxpQkFBaUI7RUFDakIsc0JBQXNCO0FBQ3hCOztBQUVBO0VBQ0UsaUJBQWlCO0VBQ2pCLGFBQWE7QUFDZjs7QUFFQTtFQUNFLGtCQUFrQjtBQUNwQjs7QUFFQTtFQUNFLFdBQVc7RUFDWCxpQkFBaUI7RUFDakIsa0JBQWtCO0VBQ2xCLFlBQVk7RUFDWixZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxrQkFBa0I7QUFDcEI7O0FBRUE7RUFDRSxvQkFBYTtFQUFiLGFBQWE7RUFDYixvQkFBb0I7QUFDdEI7O0FBRUE7RUFDRSx5QkFBeUIsRUFBRSxhQUFhO0FBQzFDOztBQUVBO0VBQ0UsZ0NBQWdDO0NBQ2pDLDRGQUE4RDtDQUE5RCw4REFBOEQ7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Bjb2xvcjp3aGl0ZSAhaW1wb3J0YW50O1xufVxuXG46Om5nLWRlZXAgYXBwLXNldHVwIC5tYXQtZm9ybS1maWVsZC11bmRlcmxpbmUge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiB3aGl0ZSAhaW1wb3J0YW50O1xufVxuXG46Om5nLWRlZXAgYXBwLXNldHVwIC5tYXQtZm9ybS1maWVsZC5tYXQtZm9jdXNlZCAubWF0LWZvcm0tZmllbGQtcmlwcGxlIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogd2hpdGUgIWltcG9ydGFudDtcbn1cblxuOjpuZy1kZWVwIGFwcC1zZXR1cCAubWF0LWZvcm0tZmllbGQtdW5kZXJsaW5lIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogd2hpdGUgIWltcG9ydGFudDtcbn1cblxuYXBwLXNldHVwIC5tYXQtaW5wdXQtcGxhY2Vob2xkZXIge1xuICBjb2xvcjogd2hpdGU7XG59XG5cbi5lbmNvdW50ZXJzLWVycm9yIHtcbiAgd2lkdGg6IDUwJTtcbiAgbWFyZ2luLWJvdHRvbTogMTZweDtcbiAgd2hpdGUtc3BhY2U6IHByZS13cmFwO1xuICB3b3JkLWJyZWFrOiBicmVhay1hbGw7XG59XG4iXX0= */\"","module.exports = \"\\n

{{uiConstants.INITIAL_CONFIGURATION_HEADER}}  

\\n \\n
\\n \\n
\\n
\\n
\\n \\n
\\n
\\n
\\n

{{uiConstants.WHICH_ENCOUNTER_FIRST}}

\\n \\n \\n errorError loading patient encounters.\\n Technical details:
{{setupDataService.encountersError.message}}\\n
\\n \\n
\\n \\n {{encounter.period.toFormat('MM/dd/yyyy')}} {{uiConstants.ENCOUNTER}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_THREE_MONTHS}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_MONTH}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_SEVEN_DAYS}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_THREE_DAYS}}\\n \\n
\\n
\\n \\n {{uiConstants.LAST_ONE_DAY}}\\n \\n
\\n
\\n
\\n
\\n

{{uiConstants.WHICH_CONCEPTS_FIRST}}

\\n \\n \\n
\\n
\\n \\n \\n search\\n \\n
\\n
\\n

{{entry[0].label}}

\\n
\\n
\\n \\n {{element.label}} {{uiConstants.NO_DATA_PAST_SIX_MOS}}\\n {{uiConstants.CHECKING_DATA_AVAILABILITY}}\\n \\n
\\n
\\n
\\n {{uiConstants.NO_RESULTS}}\\n
\\n
\\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, Inject, OnDestroy, OnInit, ViewChild} from '@angular/core';\nimport {FormControl} from '@angular/forms';\nimport {MatRadioGroup} from '@angular/material/radio';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {DateTime, Interval} from 'luxon';\nimport {Observable} from 'rxjs';\nimport {map, startWith} from 'rxjs/operators';\nimport {APP_TIMESPAN, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {environment} from '../../environments/environment';\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\nimport {ResourceCodeManager} from '../clinicalconcepts/resource-code-manager';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {FhirService} from '../fhir.service';\nimport {AxisGroup} from '../graphtypes/axis-group';\nimport {ResultError} from '../result-error';\nimport {SetupDataService} from '../setup-data.service';\n\nenum LoadStatus {\n LOADING,\n DATA_AVAILABLE,\n DATA_UNAVAILABLE\n}\n\n/**\n * Contains the intial configuration options for the MedTimeLine.\n * Users can choose which concepts to display, or pick the default\n * configuration.\n */\n@Component({\n selector: 'app-setup',\n templateUrl: './setup.component.html',\n styleUrls: ['./setup.component.css']\n})\nexport class SetupComponent implements OnInit, OnDestroy {\n readonly allConcepts = new Array();\n readonly checkedConcepts = new Map();\n readonly chosenConcepts = new Array();\n readonly useDebugger = environment.useDebugger;\n\n readonly statusConsts = LoadStatus;\n\n /**\n * Which encounter to load into the app first.\n */\n @ViewChild(MatRadioGroup) selectedDateRange: MatRadioGroup;\n\n /**\n * This FormControl monitors changes in the user input typed in the\n * autocomplete.\n */\n readonly conceptCtrl = new FormControl();\n /**\n * An Observable of filtered [DisplayGrouping, ResourceCodesForCard[] pairings\n * based on user input in the autocomplete. Each element of the array contains\n * a DisplayGrouping and filtered ResourceCodesForCards that belong to that\n * DisplayGrouping.\n */\n displayGroupingOptions: Observable>;\n\n /**\n * An array of DisplayGroupings and AxisGroup that belong to that\n * grouping.\n */\n readonly displayGroupings: Array<[DisplayGrouping, AxisGroup[]]>;\n\n /**\n * Holds whether there's any data available for each resource code group.\n */\n readonly codeGroupAvailable = new Map();\n\n /**\n * List of times the patient was in the hospital.\n */\n encounters: Encounter[];\n\n // Fixed time periods to offer as options for selection.\n today: DateTime = DateTime.local().startOf('day');\n readonly lastOneDay =\n Interval.fromDateTimes(this.today.minus({days: 1}), this.today);\n readonly lastThreeDays =\n Interval.fromDateTimes(this.today.minus({days: 3}), this.today);\n readonly lastSevenDays =\n Interval.fromDateTimes(this.today.minus({days: 7}), this.today);\n readonly lastMonth =\n Interval.fromDateTimes(this.today.minus({months: 1}), this.today);\n readonly lastThreeMonths =\n Interval.fromDateTimes(this.today.minus({months: 3}), this.today);\n\n sortResources = (function(a, b) {\n return a.label.localeCompare(b.label);\n });\n\n ngOnDestroy() {\n // Pass the selected information through to the setup data service.\n this.setupDataService.selectedConcepts = this.chosenConcepts;\n this.setupDataService.encounters = this.encounters;\n this.setupDataService.selectedDateRange = this.selectedDateRange.value ?\n this.selectedDateRange.value :\n Interval.fromDateTimes(this.today.minus({days: 7}), this.today);\n }\n\n constructor(\n resourceCodeManager: ResourceCodeManager, private route: ActivatedRoute,\n private router: Router, private setupDataService: SetupDataService,\n private fhirService: FhirService,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n // Set up jut a couple things so we don't have to hold on to them as\n // unnecessary class variables.\n const displayGroups = resourceCodeManager.getDisplayGroupMapping();\n /* Load in the concepts to display, flattening them all into a\n * single-depth array. */\n this.allConcepts = Array.from(displayGroups.values())\n .reduce((acc, val) => acc.concat(val), []);\n\n this.displayGroupings = Array.from(displayGroups.entries());\n }\n\n ngOnInit() {\n // Watch for changes to the user input on the autocomplete panel.\n this.displayGroupingOptions = this.conceptCtrl.valueChanges.pipe(\n startWith(''), // The autocomplete input starts with nothing typed in.\n map(concept => concept ? this.filter(concept) :\n this.displayGroupings.slice()));\n\n for (const concept of this.allConcepts) {\n this.checkedConcepts[concept.label] = false;\n const showByDefault =\n concept.axes.some(axis => axis.resourceGroup.showByDefault);\n if (showByDefault) {\n this.checkedConcepts[concept.label] = true;\n }\n }\n\n // Retrieve the patient encounters. When they load in asynchronously,\n // the radio buttons for encounter selection will show up.\n this.setupDataService.encountersError = null;\n this.fhirService.getEncountersForPatient(APP_TIMESPAN)\n .then(\n encounters => {\n if (encounters.length > 0) {\n this.encounters = encounters.sort(\n (a, b) =>\n a.period.start.toMillis() - b.period.start.toMillis());\n }\n },\n rejection => {\n if (rejection instanceof ResultError) {\n this.setupDataService.encountersError = rejection;\n } else if (rejection instanceof Error) {\n this.setupDataService.encountersError =\n new ResultError(new Set(), rejection.message);\n } else {\n this.setupDataService.encountersError =\n new ResultError(new Set(), '', rejection);\n }\n });\n\n // Check to see which clinical concepts have any data, and enable/disable\n // on that basis.\n this.displayGroupings.forEach(grouping => {\n const resourceCodes = grouping[1];\n resourceCodes.forEach(rsc => {\n this.codeGroupAvailable.set(rsc.label, LoadStatus.LOADING);\n rsc.dataAvailableInAppTimeScope().then(available => {\n if (!available) {\n this.checkedConcepts[rsc.label] = false;\n this.codeGroupAvailable.set(rsc.label, LoadStatus.DATA_UNAVAILABLE);\n } else {\n this.codeGroupAvailable.set(rsc.label, LoadStatus.DATA_AVAILABLE);\n }\n });\n });\n });\n }\n\n /**\n * The user wishes to continue to the main screen of MedTimeLine, with all\n * charts selected.\n */\n onContinue() {\n for (const concept of this.allConcepts) {\n if (this.checkedConcepts[concept.label]) {\n this.chosenConcepts.push(concept);\n }\n }\n this.router.navigate(['/main'], {skipLocationChange: true});\n }\n\n /**\n * The user wishes to select all concepts.\n */\n selectAll() {\n for (const concept of this.allConcepts) {\n if (this.codeGroupAvailable.has(concept.label) &&\n this.codeGroupAvailable.get(concept.label) !==\n LoadStatus.DATA_UNAVAILABLE) {\n this.checkedConcepts[concept.label] = true;\n }\n }\n }\n\n /**\n * The user wishes to clear all select concepts.\n */\n clearAll() {\n for (const concept of this.allConcepts) {\n this.checkedConcepts[concept.label] = false;\n }\n }\n\n /**\n * Filter the concepts shown on the autocomplete menu.\n */\n filter(concept): any[] {\n return this.displayGroupings\n .filter(\n entry => entry[1].some(\n codes => codes.label.toLowerCase().indexOf(\n concept.toLowerCase()) === 0))\n .map(function(entry) {\n const displayGrouping: DisplayGrouping = entry[0];\n const resourceCodesFiltered = entry[1].filter(\n codes => codes.label.toLowerCase().indexOf(\n concept.toLowerCase()) === 0);\n return [displayGrouping, resourceCodesFiltered];\n });\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {InjectionToken} from '@angular/core';\nexport let SMART_ON_FHIR_CLIENT = new InjectionToken('SmartOnFhirClient');\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport * as Color from 'color';\n/**\n * Encodings of the colors for Verily branding.\n */\n\n// Primary color palette\nexport const GREY_900 = Color('#202020');\nexport const BLACK = Color('#000000');\nexport const BLUE_A400 = Color('#2878FF');\nexport const BLUE_A700 = Color('#2861FF');\nexport const DEEP_PURPLE_600 = Color('#5E35B1');\nexport const DEEP_PURPLE_800 = Color('#4527A0');\nexport const PINK_A700 = Color('#C41061');\nexport const PINK_900 = Color('#870D4E');\nexport const PINK_A400 = Color('#FF1643');\nexport const PINK_A700_DARKER = Color('#D40000');\nexport const BLUE_GREY_100 = Color('#C3D7DB');\nexport const BLUE_GREY_500 = Color('#5F7C8A');\nexport const BLUE_GREY_50 = Color('#EBEEF0');\nexport const WHITE = Color('#FFFFFF');\n\n// Secondary color palette\nexport const CYAN = Color('#00C6EF');\nexport const DEEP_CYAN = Color('#009DB7');\nexport const TURQUOISE = Color('#07796A');\nexport const DEEP_TURQUOISE = Color('#045B4C');\nexport const GREEN = Color('#0D8D39');\nexport const DEEP_GREEN = Color('#056823');\nexport const LIME = Color('#80BA17');\nexport const DEEP_LIME = Color('#668E0E');\nexport const GOLD = Color('#FFB233');\nexport const DEEP_GOLD = Color('#C38419');\nexport const ORANGE = Color('#FF8117');\nexport const DEEP_ORANGE = Color('#C35308');\nexport const CORAL = Color('#FF5052');\nexport const DEEP_CORAL = Color('#C14047');\n\n// Color to indicate a selected item.\nexport const SELECTED = BLUE_GREY_50;\n\nexport const ABNORMAL = PINK_A700_DARKER;\n\n/**\n * Returns all the colors that are acceptable for data points to be plotted in.\n */\nexport function getDataColors(): Color[] {\n return [BLUE_A700, DEEP_PURPLE_800, PINK_900, GREEN, GOLD, ORANGE, TURQUOISE];\n}\n","module.exports = \".datePicker {\\n background-color: white;\\n padding-top: 20px;\\n}\\n\\n.mat-form-field {\\n width: 40%;\\n margin-right: 5%;\\n margin-left: 5%;\\n}\\n\\n::ng-deep .mat-h2 {\\n margin-bottom: 0px !important;\\n}\\n\\n/* Remove extra padding below the button. */\\n\\n::ng-deep .mat-mini-fab .mat-button-wrapper {\\n padding: 0px !important;\\n}\\n\\n::ng-deep .mat-h2 {\\n margin-bottom: 0px !important;\\n}\\n\\n::ng-deep td.available{\\n color: black;\\n}\\n\\n::ng-deep td.notInEncounter {\\n color: grey !important;\\n opacity: .5;\\n text-decoration: line-through;\\n}\\n\\n::ng-deep td.inEncounter {\\n color: #4527A0 !important; /* Deep Purple 800 */\\n background-color: #e5f3ec;\\n}\\n\\n::ng-deep td.active.available.inEncounter {\\n color: white !important;\\n}\\n\\ninput {\\n font-family: 'Work Sans', sans-serif;\\n}\\n\\n/* Change colors of ngx-datepicker to match custom material theme */\\n\\n::ng-deep .ranges button.active {\\n background-color: #4527A0 !important; /* Deep Purple 800 */\\n}\\n\\n::ng-deep .md-drppicker .btn {\\n background-color: #4527A0 !important; /* Deep Purple 800 */\\n}\\n\\n::ng-deep td.active.available {\\n background-color: #4527A0 !important; /* Deep Purple 800 */\\n}\\n\\n.errorIcon {\\n width: 40px;\\n height: 40px;\\n line-height: 40px;\\n cursor: default;\\n}\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvdGltZWxpbmUtY29udHJvbGxlci90aW1lbGluZS1jb250cm9sbGVyLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSx1QkFBdUI7RUFDdkIsaUJBQWlCO0FBQ25COztBQUVBO0VBQ0UsVUFBVTtFQUNWLGdCQUFnQjtFQUNoQixlQUFlO0FBQ2pCOztBQUVBO0VBQ0UsNkJBQTZCO0FBQy9COztBQUVBLDJDQUEyQzs7QUFDM0M7RUFDRSx1QkFBdUI7QUFDekI7O0FBRUE7RUFDRSw2QkFBNkI7QUFDL0I7O0FBRUE7RUFDRSxZQUFZO0FBQ2Q7O0FBRUE7RUFDRSxzQkFBc0I7RUFDdEIsV0FBVztFQUNYLDZCQUE2QjtBQUMvQjs7QUFFQTtFQUNFLHlCQUF5QixFQUFFLG9CQUFvQjtFQUMvQyx5QkFBeUI7QUFDM0I7O0FBRUE7RUFDRSx1QkFBdUI7QUFDekI7O0FBRUE7RUFDRSxvQ0FBb0M7QUFDdEM7O0FBRUEsbUVBQW1FOztBQUNuRTtFQUNFLG9DQUFvQyxFQUFFLG9CQUFvQjtBQUM1RDs7QUFFQTtFQUNFLG9DQUFvQyxFQUFFLG9CQUFvQjtBQUM1RDs7QUFFQTtFQUNFLG9DQUFvQyxFQUFFLG9CQUFvQjtBQUM1RDs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cblxuOjpuZy1kZWVwIHRkLmFjdGl2ZS5hdmFpbGFibGUuaW5FbmNvdW50ZXIge1xuICBjb2xvcjogd2hpdGUgIWltcG9ydGFudDtcbn1cblxuaW5wdXQge1xuICBmb250LWZhbWlseTogJ1dvcmsgU2FucycsIHNhbnMtc2VyaWY7XG59XG5cbi8qIENoYW5nZSBjb2xvcnMgb2Ygbmd4LWRhdGVwaWNrZXIgdG8gbWF0Y2ggY3VzdG9tIG1hdGVyaWFsIHRoZW1lICovXG46Om5nLWRlZXAgLnJhbmdlcyBidXR0b24uYWN0aXZlIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzQ1MjdBMCAhaW1wb3J0YW50OyAvKiBEZWVwIFB1cnBsZSA4MDAgKi9cbn1cblxuOjpuZy1kZWVwIC5tZC1kcnBwaWNrZXIgLmJ0biB7XG4gIGJhY2tncm91bmQtY29sb3I6ICM0NTI3QTAgIWltcG9ydGFudDsgLyogRGVlcCBQdXJwbGUgODAwICovXG59XG5cbjo6bmctZGVlcCB0ZC5hY3RpdmUuYXZhaWxhYmxlIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogIzQ1MjdBMCAhaW1wb3J0YW50OyAvKiBEZWVwIFB1cnBsZSA4MDAgKi9cbn1cblxuLmVycm9ySWNvbiB7XG4gIHdpZHRoOiA0MHB4O1xuICBoZWlnaHQ6IDQwcHg7XG4gIGxpbmUtaGVpZ2h0OiA0MHB4O1xuICBjdXJzb3I6IGRlZmF1bHQ7XG59XG4iXX0= */\"","module.exports = \"
\\n \\n \\n warning\\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, Inject, Input, OnInit, Output, Renderer2, ViewChild} from '@angular/core';\nimport {DateTime, Duration, Interval} from 'luxon';\nimport * as moment from 'moment';\nimport {DaterangepickerDirective} from 'ngx-daterangepicker-material';\nimport {APP_TIMESPAN, recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {getDaysForIntervalSet} from '../date_utils';\nimport {Encounter} from '../fhir-data-classes/encounter';\nimport {ResultClass} from '../fhir-resource-set';\nimport {ResultError} from '../result-error';\n\n/**\n * Date range picker for selecting the time span to show in all the charts.\n *\n * There is a lot of messy date conversion in this class. The problem is that\n * we use luxon DateTime for our date handling across this application, but the\n * date range picker only works with Moment.js datetimes. The only format both\n * classes have converters for is JSDate, so we pass dates through that\n * several places.\n */\n@Component({\n selector: 'app-timeline-controller',\n templateUrl: './timeline-controller.component.html',\n styleUrls: ['./timeline-controller.component.css']\n})\nexport class TimelineControllerComponent implements OnInit {\n @Output() changeDateRange = new EventEmitter();\n @ViewChild(DaterangepickerDirective)\n pickerDirective: DaterangepickerDirective;\n\n /**\n * Holds the encounters for this patient.\n */\n @Input() encounters: Encounter[];\n\n /**\n * Holds the error if there was an error getting the encounters.\n */\n @Input() encountersError: ResultError;\n\n /**\n * Holds the date range to default to on initial setup. If unset, we'll\n * default to the last seven days.\n */\n @Input() selectedDateRange: Interval;\n\n /**\n * Holds all the ISO strings for days covered by all the patient encounters\n * above. Used to gray out datepicker options that are not part of\n * a patient's encounter.\n */\n private daysCoveredByAnEncounter = new Set();\n\n /** Bounds the dates that may be selected. */\n earliestAvailableDate = moment.utc(APP_TIMESPAN.start.toJSDate());\n readonly latestAvailableDate = moment.utc(APP_TIMESPAN.end.toJSDate());\n\n /** Selected timespan is past seven days by default. */\n readonly defaultDateRange = {\n startDate: moment(DateTime.local()\n .minus(Duration.fromObject({days: 7}))\n .startOf('day')\n .toJSDate()),\n endDate: moment(DateTime.local().startOf('day').toJSDate())\n };\n\n /**\n * The date range picker binds to this variable.\n */\n selected: {startDate: moment.Moment, endDate: moment.Moment};\n\n /** The list of encounters to display as available ranges to select. */\n readonly datePickerRanges = {};\n\n /**\n * Whether there was an encounter input into this component.\n */\n hasEncounterError = false;\n\n constructor(\n private renderer: Renderer2,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {}\n\n ngOnInit() {\n // Set the initial date range selection and fire off a change event.\n const selectedRange = {\n startDate: moment(this.selectedDateRange.start.startOf('day').toJSDate()),\n endDate: moment(this.selectedDateRange.end.startOf('day').toJSDate())\n };\n this.selected = selectedRange;\n this.datesUpdated(selectedRange);\n\n // Set up the encounters in the date picker.\n if (this.encounters && this.encounters.length > 0 &&\n !this.encountersError) {\n this.hasEncounterError = false;\n\n this.encounters = this.encounters.sort(\n (a, b) => a.period.start.toMillis() - b.period.start.toMillis());\n\n // Set the minimum date to select to be the beginning of the\n // earliest encounter that had days that fell inside the app\n // timespan, in UTC.\n this.earliestAvailableDate = moment(\n this.encounters[0].period.start.startOf('day').toUTC().toJSDate());\n\n // We have to store everything as an ISO string because if we\n // store as objects the set membership check doesn't work.\n this.daysCoveredByAnEncounter = new Set(\n getDaysForIntervalSet(this.encounters.map(x => x.period))\n .map(x => x.toISO().slice(0, 10)));\n\n // We manually update the ranges stored in the daterangepicker\n // so that the list of encounters is displayed.\n // We store these in local time to prevent errors with\n // displaying a date different than the dates of the encounter.\n // While being communicated with charts, the interval will be\n // converted to UTC.\n for (const encounter of this.encounters) {\n const start = moment(encounter.period.start.startOf('day').toJSDate());\n const end = moment(encounter.period.end.endOf('day').toJSDate());\n const label =\n start.format('MM/DD/YYYY') + '-' + end.format('MM/DD/YYYY');\n this.datePickerRanges[label] = [start, end];\n }\n this.datePickerRanges[this.uiConstants.LAST_ONE_DAY] = [\n moment(DateTime.local()\n .minus(Duration.fromObject({days: 1}))\n .startOf('day')\n .toJSDate()),\n this.defaultDateRange.endDate\n ];\n this.datePickerRanges[this.uiConstants.LAST_THREE_DAYS] = [\n moment(DateTime.local()\n .minus(Duration.fromObject({days: 3}))\n .startOf('day')\n .toJSDate()),\n this.defaultDateRange.endDate\n ];\n this.datePickerRanges[this.uiConstants.LAST_SEVEN_DAYS] =\n [this.defaultDateRange.startDate, this.defaultDateRange.endDate];\n this.datePickerRanges[this.uiConstants.LAST_MONTH] = [\n moment(DateTime.local()\n .minus(Duration.fromObject({months: 1}))\n .startOf('day')\n .toJSDate()),\n this.defaultDateRange.endDate\n ];\n this.datePickerRanges[this.uiConstants.LAST_THREE_MONTHS] = [\n moment(DateTime.local()\n .minus(Duration.fromObject({months: 3}))\n .startOf('day')\n .toJSDate()),\n this.defaultDateRange.endDate\n ];\n } else {\n this.hasEncounterError = true;\n }\n }\n\n /**\n * Used to add a style to dates in the date picker so that the user can\n * differentiate between dates inside and outside of encounters.\n */\n addCustomClass =\n (m: moment.Moment) => {\n // The slice gets jus tthe date portion of the ISO string.\n return this.daysCoveredByAnEncounter.has(m.toISOString().slice(0, 10)) ?\n 'inEncounter' :\n 'notInEncounter';\n }\n\n /**\n * Emits the date range picked in the date picker as an event.\n * @param range The date range selected in the picker.\n */\n datesUpdated(rangeIn: {startDate: moment.Moment, endDate: moment.Moment}) {\n if (!rangeIn.startDate || !rangeIn.endDate || !this.selected) {\n return;\n }\n if (rangeIn.startDate.isBefore(rangeIn.endDate)) {\n this.selected = rangeIn;\n // Convert to UTC time.\n const interval = Interval.fromDateTimes(\n DateTime.fromJSDate(rangeIn.startDate.toDate())\n .startOf('day')\n .toUTC(),\n DateTime.fromJSDate(rangeIn.endDate.toDate()).endOf('day').toUTC());\n this.changeDateRange.emit(interval);\n\n recordGoogleAnalyticsEvent(\n 'dateRangeChanged', 'timeline',\n interval.start.toLocaleString() + ' - ' +\n interval.end.toLocaleString());\n }\n }\n}\n","module.exports = \"
\\n \\n
{{uiConstants.SYNTH_DATA}}
\\n
{{uiConstants.LOINC_VERIFIED_STRING}}
\\n \\n \\n \\n \\n \\n
\\n\"","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {Component, EventEmitter, Inject, Output} from '@angular/core';\nimport {MatDialog} from '@angular/material/dialog';\nimport {recordGoogleAnalyticsEvent, UI_CONSTANTS_TOKEN} from 'src/constants';\n\nimport {environment} from '../../environments/environment';\nimport {DisplayGrouping} from '../clinicalconcepts/display-grouping';\nimport {ResourceCodeManager} from '../clinicalconcepts/resource-code-manager';\nimport {AxisGroup} from '../graphtypes/axis-group';\nimport {HelpDialogComponent} from '../help-dialog/help-dialog.component';\nimport {IfuDialogComponent} from '../ifu-dialog/ifu-dialog.component';\n\n@Component({\n selector: 'app-timeline-toolbar',\n templateUrl: './timeline-toolbar.component.html',\n styleUrls: ['../cardcontainer/cardcontainer.component.css']\n})\nexport class TimelineToolbarComponent {\n readonly displayGroupings: Array<[DisplayGrouping, AxisGroup[]]>;\n readonly showMockDataMessage = environment.useMockServer;\n\n @Output() saveSnapshot = new EventEmitter();\n @Output() addTextbox = new EventEmitter();\n\n constructor(\n resourceCodeManager: ResourceCodeManager, private helpDialog: MatDialog,\n private ifuDialog: MatDialog,\n @Inject(UI_CONSTANTS_TOKEN) readonly uiConstants: any) {\n const displayGroups = resourceCodeManager.getDisplayGroupMapping();\n this.displayGroupings = Array.from(displayGroups.entries());\n }\n\n // Emits an event indicating to CardContainer to save a snapshot of the page.\n snapshot() {\n this.saveSnapshot.emit();\n }\n\n // Emits an event indicating to CardContainer to add a blank textbox at the\n // top of the page.\n textbox() {\n this.addTextbox.emit();\n }\n\n openHelpDialog() {\n const dialogRef = this.helpDialog.open(HelpDialogComponent);\n recordGoogleAnalyticsEvent(\n 'viewTutorial', 'tutorial', new Date().toDateString());\n }\n\n openIFU() {\n const dialogRef = this.ifuDialog.open(IfuDialogComponent);\n recordGoogleAnalyticsEvent(\n 'viewTutorial', 'tutorial', new Date().toDateString());\n }\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/**\n * This function replaces abbrevations and symbols in a unit string to comply\n * with EHRA guidelines.\n * @param unit The unit string to fix abbreviations of.\n */\nexport function fixUnitAbbreviations(unit: string): string {\n if (unit) {\n return unit.replace('uL', 'microL')\n .replace('ยต', 'micro')\n .replace('DegC', 'Deg C');\n }\n return undefined;\n}\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {InjectionToken} from '@angular/core';\nimport {DateTime, Duration, Interval} from 'luxon';\n\nimport {environment} from './environments/environment';\n\nexport function recordGoogleAnalyticsEvent(\n eventName: string, eventCategory: string, eventLabel: string) {\n if ((window).gtag) {\n (window).gtag('event', eventName, {\n 'event_category': eventCategory,\n 'event_label': eventLabel\n });\n }\n}\n\n/** The period of time this app will search for patient encounters in. */\nexport const APP_TIMESPAN = environment.production ?\n Interval.fromDateTimes(\n DateTime.utc().minus(Duration.fromObject({months: 6})),\n DateTime.utc()) :\n Interval.fromDateTimes(\n DateTime.utc().minus(Duration.fromObject({months: 60})),\n DateTime.utc());\n\n/**\n * Do not consider any encounters with a start date earlier than a year from\n * now.\n */\nexport const EARLIEST_ENCOUNTER_START_DATE = DateTime.utc().minus({years: 1});\n\n/** Constants used for FHIR resource types. */\nexport enum FhirResourceType {\n Encounter = 'Encounter',\n Observation = 'Observation',\n MedicationAdministration = 'MedicationAdministration',\n MedicationOrder = 'MedicationOrder',\n DocumentReference = 'DocumentReference',\n Patient = 'Patient',\n Specimen = 'Specimen',\n Medication = 'Medication',\n DiagnosticReport = 'DiagnosticReport'\n}\n\n/**\n * Injection token for passing UI constants across the app.\n */\nexport let UI_CONSTANTS_TOKEN = new InjectionToken('UiConstantsToken');\n\n/**\n * UI constants text.\n */\nexport const UI_CONSTANTS = {\n SYNTH_DATA: 'This is synthesized data used only for demo purposes.',\n LOINC_VERIFIED_STRING:\n 'These BCH data mappings were verified 2019-04-30. v.1.0.3.0',\n // Tooltip for adding a card inline\n ADD_TIMELINE_HERE: 'Add timeline here',\n // Dialog for adding an event to the custom timeline\n ADD_TITLE_CUSTOM_EVENT: 'Add title',\n ADD_DESCRIPTION_CUSTOM_EVENT: 'Add description',\n ADD_CARD_HERE: 'Add card here',\n DATE_CUSTOM_EVENT: 'Date',\n TIME_CUSTOM_EVENT: 'Time',\n CANCEL: 'Cancel',\n SAVE: 'Save',\n CONTINUE: 'Continue',\n // Custom timeline constants\n ADD_CUSTOM_TIMELINE: 'Add Custom Timeline',\n CUSTOM_TIMELINE_LABEL: 'Custom Timeline',\n CUSTOM_TIMELINE_INSTRUCTIONS:\n 'Click on this graph to add a flag for anything you want to keep track of.',\n // Annotation constants\n ADD_ANNOTATION: 'Add Textbox',\n ANNOTATION_INSTRUCTIONS: 'Add your text here.',\n SAVE_TEXT_HINT: 'Click the save button to save your text.',\n EDIT_TEXT_HINT: 'Click the edit button to edit this text.',\n // Constants\n NO_DATA_AVAILABLE_TMPL: 'No data between ',\n // Used in menu to add timelines\n ADD_CHART: 'Add Data Timeline',\n SEARCH_FOR_A_CONCEPT: 'Search for a concept',\n // Confirmation dialog for removing a card\n REMOVE_CARD: 'Do you want to remove this card?',\n REMOVE_CARD_NO: 'No',\n REMOVE_CARD_YES: 'Yes, remove this card',\n // Error handling\n BAD_DATA_ERROR: 'Invalid data received. Please check the PowerChart.',\n BAD_ENCOUNTER_ERROR:\n 'Unable to retrieve hospital visit dates for this patient.' +\n ' You can select any time period in the past six months.',\n // Setup screen\n INITIAL_CONFIGURATION_HEADER: 'MedTimeLine',\n LAST_ONE_DAY: 'Since midnight yesterday',\n LAST_THREE_DAYS: 'Last three days',\n LAST_SEVEN_DAYS: 'Last seven days',\n LAST_MONTH: 'Last month',\n LAST_THREE_MONTHS: 'Last three months',\n NO_RESULTS: 'No results found',\n SELECT_ALL: 'Select all',\n CLEAR_SELECTION: 'Clear selection',\n NO_DATA_PAST_SIX_MOS: '(No data found for past six months)',\n CHECKING_DATA_AVAILABILITY: '(Checking data availability...)',\n WHICH_ENCOUNTER_FIRST: 'Which time period would you like to see first?',\n WHICH_CONCEPTS_FIRST: 'Which data timelines would you like to see first?',\n ENCOUNTER: '(patient encounter)',\n // Top banner constants\n CHANGE_DATE_RANGE: 'Change date range',\n MOCK_DATA_BANNER: 'This is synthesized data used for demo purposes only.',\n LAUNCH_TUTORIAL: 'Launch Tutorial',\n IFU: 'Open Instructions for Use',\n SAVE_TO_NOTE: 'Save a screenshot to a PowerChart clinical note',\n // Interacting with cards\n REMOVE_THIS_CARD: 'Remove this card',\n CARD_REMOVED: 'Card removed.',\n UNDO: 'Undo',\n DRAG_THIS_CARD: 'Drag and drop to move this card somewhere else',\n EDIT_THIS_CARD: 'Edit this card',\n SAVE_YOUR_WORK: 'Save your work on this card',\n // Saving to PowerChart\n SAVED_TO_POWERCHART: 'Screenshot saved to PowerChart.',\n ERROR_SAVED_TO_POWERCHART: 'Error saving to PowerChart.',\n DISMISS: 'Dismiss',\n};\n","// This file can be replaced during build by using the `fileReplacements` array.\n// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.\n// The list of file replacements can be found in `angular.json`.\n\nexport const environment = {\n production: false,\n useMockServer: true,\n mockDataFolder: 'demo_data/test_bmedtimeB',\n mockDataFiles: [\n 'BMedTimeB_Encounter',\n 'BMedTimeB_Obs_labs',\n 'BMedTimeB_Obs_vitals',\n 'BMedtimeB_MB_data',\n 'BMedTimeB_Med_Admins',\n 'BMedTimeB_Med_Orders',\n ],\n useDebugger: false,\n};\n\n/*\n * In development mode, to ignore zone related error stack frames such as\n * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can\n * import the following file, but please comment it out in production mode\n * because it will have performance impact when throw error\n */\nimport 'zone.js/dist/zone-error'; // Included with Angular CLI.\n","// Copyright 2018 Verily Life Sciences Inc.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\nimport {enableProdMode} from '@angular/core';\nimport {platformBrowserDynamic} from '@angular/platform-browser-dynamic';\n\nimport {AppModule} from './app/app.module';\nimport * as FhirConfig from './app/fhir_config';\nimport {environment} from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\n\nif (FhirConfig.googleAnalyticsTag) {\n // Global site tag (gtag.js) - Google Analytics\n document.write(\n ' ');\n document.write(\n '');\n} else {\n // If there is no Google Analytics Tag found, insert an empty script to\n // prevent errors with user interaction.\n document.write('');\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule).catch(\n err => console.log(err));\n"],"sourceRoot":""} \ No newline at end of file