import {Activity, CarePlan} from '@nspop/gm-web-facade-api'; import {Observable} from 'rxjs'; import {of} from 'rxjs/internal/observable/of'; import OwnershipEnum = Activity.OwnershipEnum; const past: Date = new Date(); const future: Date = new Date(); past.setDate(new Date().getDate() - 1); future.setDate(new Date().getDate() + 1); const carePlanStub1: CarePlan = { patient: '0101010489', activities: [{ practitioner: null, location: null, gestationWeek: null, plannedTime: { from: new Date('2021-08-11T15:16:47.000Z'), to: new Date('2021-08-31T15:16:47.000Z'), }, status: 'planned', ownership: 'currentUser', title: 'Konsultation hos egen læge uge 25', description: 'Drøftelse af generel trivsel, herunder eventuelle familiemæssige og arbejdsmæssige belastninger', reference: null, code: null, kind: null, id: 'edd361c9-fa99-4cf9-bedd-c72f0f0a0507', note: null, observations: [], sortDate: null }, { practitioner: null, location: null, gestationWeek: null, plannedTime: null, status: 'planned', ownership: 'currentUser', title: 'Konsultation hos egen læge 8 uger efter fødsel', description: 'Drøftelse om de kropslige og mentale ændringer, som finder sted i perioden efter fødslen', reference: null, code: null, kind: null, id: '127220a4-1fe8-4318-bf2f-3c71df0c0a91', note: null, observations: [], sortDate: null }, { practitioner: null, location: null, gestationWeek: null, plannedTime: null, status: 'planned', ownership: 'currentUser', title: 'Konsultation hos egen lægeuge 6-10', description: 'Orientering om det videre graviditetsforløb og introduktion til sundhedsvæsenets tilbud til gravide.Henvisning til fødested', reference: null, code: null, kind: null, id: '1431178c-d513-4965-9aff-cfc7e314b44a', note: null, observations: [], sortDate: null } ], processId: 'abf12343-2afc-41e1-9398-6add4a39c278', title: 'Graviditetsplan', description: 'Graviditetsplan', responsibleOrganization: { id: '112711000016007', source: 'SOR' }, id: 'urn:sds:gcp:3d3aa2e0-cbf5-4f01-915e-e5c6258f4d98', version: 11, documentStatus: 'ACTIVE' } as any as CarePlan; const carePlanStub2: CarePlan = { activities: [ { id: '1', plannedTime: { from: past, to: past}, ownership: 'currentUser' as OwnershipEnum, sortDate: past, note: undefined, observations: [], practitioner: {} as any, status: 'finished', title: 'Lægebesøg', description: 'Første konsultation ved lægen' }, { id: '2', plannedTime: { from: past, to: past}, ownership: 'otherUser' as OwnershipEnum, sortDate: past, note: undefined, observations: [], practitioner: {} as any, status: 'finished', title: 'Jordemoder', description: 'Jordemoderbesøg 1' }, { id: '3', plannedTime: { from: future, to: future}, ownership: 'currentUser' as OwnershipEnum, sortDate: future, note: undefined, observations: [], practitioner: {} as any, status: 'planned', title: 'Lægebesøg', description: 'Anden konsultation ved lægen' }, { id: '4', plannedTime: { from: future, to: future}, ownership: 'otherUser' as OwnershipEnum, sortDate: future, note: undefined, observations: [], practitioner: {} as any, status: 'planned', title: 'Jordemoder', description: 'Jordemoderbesøg 2' }, { id: '5', plannedTime: { from: future, to: future}, ownership: 'currentUser' as OwnershipEnum, sortDate: future, note: undefined, observations: [], practitioner: {} as any, status: 'expected', title: 'Lægebesøg', description: 'Tredje konsultation ved lægen' }, { id: '6', plannedTime: { from: future, to: future}, ownership: 'otherUser' as OwnershipEnum, sortDate: future, note: undefined, observations: [], practitioner: {} as any, status: 'expected', title: 'Jordemoder', description: 'Jordemoderbesøg 3' }, { id: '7', plannedTime: { from: future, to: future}, ownership: 'currentUser' as OwnershipEnum, sortDate: future, note: undefined, observations: [], practitioner: {} as any, status: 'cancelled', title: 'Lægebesøg', description: 'Fjerde konsultation ved lægen' }, { id: '8', plannedTime: { from: future, to: future}, ownership: 'otherUser' as OwnershipEnum, sortDate: future, note: undefined, observations: [], practitioner: {} as any, status: 'cancelled', title: 'Jordemoder', description: 'Jordemoderbesøg 4' }, ], description: 'Sample description', id: '7f37ccc1-19d2-4544-bd5e-8263905b4282', patient: '0101010101', processId: '7abf9cb4-f5b2-4ac3-a70e-610a3d583c38', responsibleOrganization: {id: 'some-organization-id', source: '293591000016003'}, title: 'Sample title', version: 1, }; const carePlanStub3 = { patient: '0101010489', activities: [ { status: 'planned', ownership: 'currentUser', title: 'Helt ny aftale', description: 'Dette er en ny aftale oprettet via "Tilføj ny aftale"', reference: null, code: null, kind: null, id: 'b0e9703b-ab3a-4aee-83ea-7a5f18f23fd2', note: null, observations: [ { dateOfMeasurement: new Date('2021-03-25T12:28:28.000Z'), values: [ { value: '122', unit: '[mm/Hg]', name: 'DNK05472' }, { value: '78', unit: '[mm/Hg]', name: 'DNK05473' } ], measuredBy: 'Jacob Kjer Speciall�ge', enteredBy: null, completed: null, fetus: null, activityReference: null, type: 'blood_pressure', id: '8f4437d4-456d-41cb-b6d8-37ceb2ccede4', version: 1, dirty: null } ], sortDate: null } ], processId: 'abf12343-2afc-41e1-9398-6add4a39c278', title: 'Graviditetsplan', description: 'Graviditetsplan', responsibleOrganization: { id: '112711000016007', source: 'SOR' }, id: 'urn:sds:gcp:3d3aa2e0-cbf5-4f01-915e-e5c6258f4d98', version: 11, documentStatus: 'ACTIVE' } as any as CarePlan; const dataToBeStubbed: CarePlan = carePlanStub2; export const carePlanStub$: Observable = of(dataToBeStubbed); export const activitiesStub$: Observable = of(dataToBeStubbed.activities || []);