@uxland-admin/ip-context-info
Advanced tools
Comparing version 1.0.6 to 1.0.7
import { createSelector } from "reselect"; | ||
import { appContextInfoSelector } from "../../selector"; | ||
export const contextInfoSelector = createSelector(appContextInfoSelector, res => res && res.contextInfo); | ||
export const contextInfoView = createSelector(contextInfoSelector, (res) => res && res.state && res.state.description); | ||
export const diagnosticView = createSelector(contextInfoSelector, (res) => res && res.state && res.state.diagnostic); | ||
export const contextInfoView = createSelector(contextInfoSelector, (res) => res && res.state); |
import { html } from '@polymer/lit-element'; | ||
export default html `<style>mwc-fab{--mdc-theme-secondary: #00bcd4}mwc-button{--mdc-theme-primary: #26c5da}mwc-checkbox{--mdc-theme-secondary: #26c5da}#app-container{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;flex:1;height:100vh}.content{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap;border-bottom:1px solid #ffffff14}.summary-text{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;flex:1 0 50%}.summary-data{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;flex:1 0 50%}.text-item{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;margin-bottom:32px}.text-item .label{opacity:.6;font-weight:300}.text-item .value{font-size:1.714rem;line-height:24px;font-weight:300}.data-item{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;margin-bottom:32px}.data-item iron-icon{margin-right:10px;width:55px;height:40px;opacity:.7}.data-info{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.data-info .label{opacity:.6;font-weight:300}.data-info .value{font-size:1.714rem;line-height:1.714rem;font-weight:300} | ||
export default html `<style>mwc-fab{--mdc-theme-secondary: #00bcd4}mwc-button{--mdc-theme-primary: #26c5da}mwc-checkbox{--mdc-theme-secondary: #26c5da}#app-container{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;flex:1;height:100vh}.content{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.patient-header{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;-ms-flex-align:center;-webkit-align-items:center;align-items:center;border-bottom:1px solid #1263a4;margin-bottom:32px;padding-bottom:32px}.name{font-size:1.714rem;line-height:1.714rem;font-weight:300;margin-right:32px}.metadata{opacity:.6;font-weight:300;font-size:1.143rem}.summary{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap;border-bottom:1px solid #ffffff14}.summary-text{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;flex:1 0 50%}.summary-data{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;flex:1 0 50%}.text-item{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column;margin-bottom:32px}.text-item .label{opacity:.6;font-weight:300}.text-item .value{font-size:1.714rem;line-height:24px;font-weight:300}.text-item .value span{margin-right:24px}.text-item .value span:first-letter{text-transform:uppercase}.data-item{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row;margin-bottom:32px}.data-item iron-icon{margin-right:10px;width:55px;height:40px;opacity:.7}.data-info{display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.data-info .label{opacity:.6;font-weight:300}.data-info .value{font-size:1.714rem;line-height:1.714rem;font-weight:300} | ||
</style>`; |
@@ -6,34 +6,45 @@ import { html } from '@polymer/lit-element/lit-element'; | ||
<div class="content"> | ||
<div class="summary-text"> | ||
<div class="text-item"> | ||
<div class="label">${props.localize(`${moduleName}.diagnostic`)}</div> | ||
<div class="value">Hernia inguinal unilateral dreta</div> | ||
<div class="patient-header"> | ||
<div class="name"> | ||
<span>${props.contextInfo.name}</span><span>${props.contextInfo.firstSurname}</span> | ||
</div> | ||
<div class="metadata"> | ||
${props.localize(props.contextInfo.gender == 'male' ? `${moduleName}.genderMale` : `${moduleName}.genderFemale`)}, ${props.computeRelativeTime(props.contextInfo.birthdate)} | ||
</div> | ||
<div class="text-item"> | ||
<div class="label">${props.localize(`${moduleName}.moment`)}</div> | ||
<div class="value">${props.contextInfo}</div> | ||
</div> | ||
<div class="text-item"> | ||
<div class="label">${props.localize(`${moduleName}.origen`)}</div> | ||
<div class="value">CAP Horta</div> | ||
</div> | ||
<div class="text-item"> | ||
<div class="label">${props.localize(`${moduleName}.motiu`)}</div> | ||
<div class="value">Control hernia</div> | ||
</div> | ||
</div> | ||
<div class="summary-data"> | ||
<div class="data-item"> | ||
<iron-icon icon="ip-ci-icons:today"></iron-icon> | ||
<div class="data-info"> | ||
<div class="label">${props.localize(`${moduleName}.primeraVisita`)}</div> | ||
<div class="value">2 Octubre 2017</div> | ||
<div class="summary"> | ||
<div class="summary-text"> | ||
<div class="text-item"> | ||
<div class="label">${props.localize(`${moduleName}.diagnostic`)}</div> | ||
<div class="value">${props.contextInfo.diagnostic}</div> | ||
</div> | ||
<div class="text-item"> | ||
<div class="label">${props.localize(`${moduleName}.moment`)}</div> | ||
<div class="value">${props.contextInfo.description}</div> | ||
</div> | ||
<div class="text-item"> | ||
<div class="label">${props.localize(`${moduleName}.origen`)}</div> | ||
<div class="value">${props.contextInfo.origin}</div> | ||
</div> | ||
<div class="text-item"> | ||
<div class="label">${props.localize(`${moduleName}.motiu`)}</div> | ||
<div class="value">${props.contextInfo.reason}</div> | ||
</div> | ||
</div> | ||
<div class="data-item"> | ||
<iron-icon icon="ip-ci-icons:total"></iron-icon> | ||
<div class="data-info"> | ||
<div class="label">${props.localize(`${moduleName}.totalVisites`)}</div> | ||
<div class="value">3</div> | ||
<div class="summary-data"> | ||
<div class="data-item"> | ||
<iron-icon icon="ip-ci-icons:today"></iron-icon> | ||
<div class="data-info"> | ||
<div class="label">${props.localize(`${moduleName}.primeraVisita`)}</div> | ||
<div class="value">${props.formatDate(props.contextInfo.begindate)}</div> | ||
</div> | ||
</div> | ||
<div class="data-item"> | ||
<iron-icon icon="ip-ci-icons:total"></iron-icon> | ||
<div class="data-info"> | ||
<div class="label">${props.localize(`${moduleName}.totalVisites`)}</div> | ||
<div class="value">${props.contextInfo.visits}</div> | ||
</div> | ||
</div> | ||
</div> | ||
@@ -40,0 +51,0 @@ </div> |
@@ -8,2 +8,4 @@ import * as tslib_1 from "tslib"; | ||
import { contextInfoView } from "../../app/context-info/context-info-view"; | ||
import { format, differenceInYears } from 'date-fns'; | ||
import { moduleName } from "../../constants"; | ||
let IpCiDialogItem = class IpCiDialogItem extends Locale(LitElement) { | ||
@@ -13,2 +15,8 @@ render() { | ||
} | ||
computeRelativeTime(date) { | ||
return `${differenceInYears(new Date(), date)} ${this.localize(`${moduleName}.years`)}`; | ||
} | ||
formatDate(date) { | ||
return format(date, 'dd/MM/YYYY', { awareOfUnicodeTokens: true }); | ||
} | ||
}; | ||
@@ -15,0 +23,0 @@ tslib_1.__decorate([ |
@@ -8,3 +8,3 @@ import { html } from '@polymer/lit-element/lit-element'; | ||
${props.contextInfo | ||
? html `<div id="context-info-toolbar">${props.contextInfo} - ${props.localize(`${moduleName}.diagnostic`)}: ${props.diagnosticInfo}</div>` | ||
? html `<div id="context-info-toolbar">${props.contextInfo.description} - ${props.localize(`${moduleName}.diagnostic`)}: ${props.contextInfo.diagnostic}</div>` | ||
: html `-`} | ||
@@ -11,0 +11,0 @@ <div ?hidden="${!props.displayInfo}" id="context-info-dialog"> |
@@ -9,3 +9,3 @@ import * as tslib_1 from "tslib"; | ||
import { template as TEMPLATE } from './ip-ci-template.js'; | ||
import { contextInfoView, diagnosticView } from "../../app/context-info/context-info-view"; | ||
import { contextInfoView } from "../../app/context-info/context-info-view"; | ||
import { fetchContextInfo } from "../../app/context-info/fetch-context-info"; | ||
@@ -44,6 +44,2 @@ import { region } from '@uxland/uxl-regions/region-decorator'; | ||
tslib_1.__decorate([ | ||
property({ statePath: diagnosticView }), | ||
tslib_1.__metadata("design:type", String) | ||
], IpCi.prototype, "diagnosticInfo", void 0); | ||
tslib_1.__decorate([ | ||
property(), | ||
@@ -50,0 +46,0 @@ tslib_1.__metadata("design:type", Boolean) |
@@ -17,2 +17,8 @@ declare module '@uxland-admin/ip-context-info/constants' { | ||
primeraVisita: string; | ||
name: string; | ||
age: string; | ||
gender: string; | ||
years: string; | ||
genderMale: string; | ||
genderFemale: string; | ||
}; | ||
@@ -32,4 +38,15 @@ }; | ||
export interface ContextInfo { | ||
id: string; | ||
description: string; | ||
diagnostic: string; | ||
name: string; | ||
firstsurname: string; | ||
secondsurname: string; | ||
birthdate: string; | ||
gender: string; | ||
begindate: string; | ||
enddate: string; | ||
reason: string; | ||
visits: string; | ||
origin: string; | ||
} | ||
@@ -69,4 +86,3 @@ export const FETCH_CONTEXT_INFO: any; | ||
export const contextInfoSelector: import("reselect").OutputSelector<import("../../reducer").AppContextInfoState, AsyncState<ContextInfo>, (res: import("../../reducer").ContextInfoState) => AsyncState<ContextInfo>>; | ||
export const contextInfoView: import("reselect").OutputSelector<import("../../reducer").AppContextInfoState, string, (res: AsyncState<ContextInfo>) => string>; | ||
export const diagnosticView: import("reselect").OutputSelector<import("../../reducer").AppContextInfoState, string, (res: AsyncState<ContextInfo>) => string>; | ||
export const contextInfoView: import("reselect").OutputSelector<import("../../reducer").AppContextInfoState, ContextInfo, (res: AsyncState<ContextInfo>) => ContextInfo>; | ||
@@ -104,3 +120,2 @@ } | ||
contextInfo: string; | ||
diagnosticInfo: string; | ||
displayInfo: boolean; | ||
@@ -129,2 +144,4 @@ onClickToolbar(e: any): void; | ||
contextInfo: string; | ||
computeRelativeTime(date: any): string; | ||
formatDate(date: any): string; | ||
} | ||
@@ -131,0 +148,0 @@ export {}; |
@@ -10,3 +10,9 @@ import { moduleName } from "./constants"; | ||
totalVisites: 'Total de visites', | ||
primeraVisita: 'Primera visita' | ||
primeraVisita: 'Primera visita', | ||
name: 'Pacient', | ||
age: 'Edat', | ||
gender: 'Sexe', | ||
years: 'Anys', | ||
genderMale: 'Home', | ||
genderFemale: 'Dona' | ||
} | ||
@@ -13,0 +19,0 @@ }, |
{ | ||
"name": "@uxland-admin/ip-context-info", | ||
"description": "ICS Process - Context info", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23385
413