Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

import { ProgressNote } from '../models/patientModels';
import { environment } from '../../environments/environment';
import * as _ from 'lodash';

export function processDocumentData(data: ProgressNote[], dataType: string) {

let xdata: ProgressNote[] = [];

// if we're in a development environment, manually filter results, either PN notes or CWAD
if (environment.sessionServices.appEnv === 'development') {
for (let i = 0; i < data.length; i++) {
if (((!data[i].docType && dataType === 'progressNotes') ||
(data[i].docType && data[i].docType === 'PN' && dataType === 'progressNotes'))
|| (data[i].docType && data[i].docType.match(/^(C|W|A|D)$/) && dataType === 'cwad')) {
xdata.push(data[i]);
}
}
} else {
xdata = JSON.parse(JSON.stringify(data));
}

// CWAD records are only used if signed...
if (dataType === 'cwad') {
_.remove(xdata, (itm) => !itm.signature);
}

return xdata;

}