| 1 | //kt -- Modified with SourceScanner on 8/17/2007 | 
|---|
| 2 | unit uDCSumm; | 
|---|
| 3 |  | 
|---|
| 4 | interface | 
|---|
| 5 |  | 
|---|
| 6 | uses SysUtils, Classes, ORNet, ORFn, rCore, uCore, uConst; | 
|---|
| 7 |  | 
|---|
| 8 | type | 
|---|
| 9 | TEditDCSummRec = record | 
|---|
| 10 | Title: Integer; | 
|---|
| 11 | DocType: integer; | 
|---|
| 12 | Addend: integer; | 
|---|
| 13 | EditIEN: integer; | 
|---|
| 14 | AdmitDateTime: TFMDateTime; | 
|---|
| 15 | DischargeDateTime: TFMDateTime; | 
|---|
| 16 | TitleName: string; | 
|---|
| 17 | DictDateTime: TFMDateTime; | 
|---|
| 18 | Dictator: Int64; | 
|---|
| 19 | DictatorName: string; | 
|---|
| 20 | Cosigner: Int64; | 
|---|
| 21 | CosignerName: string; | 
|---|
| 22 | Transcriptionist: int64; | 
|---|
| 23 | TranscriptionistName: string; | 
|---|
| 24 | Attending: int64; | 
|---|
| 25 | AttendingName: string; | 
|---|
| 26 | Urgency: string; | 
|---|
| 27 | UrgencyName: string; | 
|---|
| 28 | Location: Integer; | 
|---|
| 29 | LocationName: string; | 
|---|
| 30 | VisitStr: string; | 
|---|
| 31 | NeedCPT: Boolean; | 
|---|
| 32 | Status: integer; | 
|---|
| 33 | LastCosigner: Int64; | 
|---|
| 34 | LastCosignerName: string; | 
|---|
| 35 | IDParent: integer; | 
|---|
| 36 | Lines: TStrings; | 
|---|
| 37 | end; | 
|---|
| 38 |  | 
|---|
| 39 | TDCSummRec = TEditDCSummRec; | 
|---|
| 40 |  | 
|---|
| 41 | TAdmitRec = record | 
|---|
| 42 | AdmitDateTime: TFMDateTime; | 
|---|
| 43 | Location: integer; | 
|---|
| 44 | LocationName: string; | 
|---|
| 45 | VisitStr: string; | 
|---|
| 46 | end; | 
|---|
| 47 |  | 
|---|
| 48 | TDCSummTitles = class | 
|---|
| 49 | DfltTitle: Integer; | 
|---|
| 50 | DfltTitleName: string; | 
|---|
| 51 | ShortList: TStringList; | 
|---|
| 52 | constructor Create; | 
|---|
| 53 | destructor Destroy; override; | 
|---|
| 54 | end; | 
|---|
| 55 |  | 
|---|
| 56 | TDCSummPrefs = class | 
|---|
| 57 | DfltLoc: Integer; | 
|---|
| 58 | DfltLocName: string; | 
|---|
| 59 | SortAscending: Boolean; | 
|---|
| 60 | AskCosigner: Boolean; | 
|---|
| 61 | DfltCosigner: Int64; | 
|---|
| 62 | DfltCosignerName: string; | 
|---|
| 63 | MaxSumms: Integer; | 
|---|
| 64 | end; | 
|---|
| 65 |  | 
|---|
| 66 | function  MakeDCSummDisplayText(RawText: string): string; | 
|---|
| 67 |  | 
|---|
| 68 | implementation | 
|---|
| 69 |  | 
|---|
| 70 | function MakeDCSummDisplayText(RawText: string): string; | 
|---|
| 71 | var | 
|---|
| 72 | x: string; | 
|---|
| 73 | begin | 
|---|
| 74 | x := RawText; | 
|---|
| 75 | if Copy(Piece(x, U, 9), 1, 4) = '    ' then SetPiece(x, U, 9, 'Dis: '); | 
|---|
| 76 | if Piece(x, U, 1)[1] in ['A', 'N', 'E'] then | 
|---|
| 77 | Result := Piece(x, U, 2) | 
|---|
| 78 | else | 
|---|
| 79 | Result := FormatFMDateTime('mmm dd,yy', MakeFMDateTime(Piece(x, U, 3))) + '  ' + | 
|---|
| 80 | Piece(x, U, 2) + ', ' + Piece(x, U, 6) + ', ' + Piece(Piece(x, U, 5), ';', 2) + | 
|---|
| 81 | '  (' + Piece(x,U,7) + '), ' + Piece(Piece(x, U, 8), ';', 1) + ', ' + | 
|---|
| 82 | Piece(Piece(x, U, 9), ';', 1); | 
|---|
| 83 | end; | 
|---|
| 84 |  | 
|---|
| 85 | { Discharge Summary Titles  -------------------------------------------------------------------- } | 
|---|
| 86 |  | 
|---|
| 87 | constructor TDCSummTitles.Create; | 
|---|
| 88 | { creates an object to store Discharge Summary titles so only obtained from server once } | 
|---|
| 89 | begin | 
|---|
| 90 | inherited Create; | 
|---|
| 91 | ShortList := TStringList.Create; | 
|---|
| 92 | end; | 
|---|
| 93 |  | 
|---|
| 94 | destructor TDCSummTitles.Destroy; | 
|---|
| 95 | { frees the lists that were used to store the Discharge Summary titles } | 
|---|
| 96 | begin | 
|---|
| 97 | ShortList.Free; | 
|---|
| 98 | inherited Destroy; | 
|---|
| 99 | end; | 
|---|
| 100 |  | 
|---|
| 101 | end. | 
|---|