Changeset 1591 for smart/trunk


Ignore:
Timestamp:
Oct 30, 2012, 1:53:46 PM (12 years ago)
Author:
Sam Habiel
Message:

Updated license for routines

Location:
smart/trunk/p
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • smart/trunk/p/C0SDEM.m

    r1571 r1591  
    1 C0SDEM    ; GPL - Smart Demographics Processing ;2/22/12  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
    5         ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
    10         ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
    15         ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     1C0SDEM    ; GPL - Smart Demographics Processing ; 10/30/12 10:59am
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2012 George Lilly. 
     4        ;
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
     9        ;
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
     14        ;
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        Q
  • smart/trunk/p/C0SDOM.m

    r1571 r1591  
    11C0SDOM    ; GPL - Smart Container - DOM PROCESSING ROUTINES ;6/6/11  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2011,2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
    5         ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
    10         ;
    11        
    12         ;This program is distributed in the hope that it will be useful,
    13         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    14         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15         ;GNU General Public License for more details.
    16         ;
    17         ;You should have received a copy of the GNU General Public License along
    18         ;with this program; if not, write to the Free Software Foundation, Inc.,
    19         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2011,2012 George Lilly. 
     4        ;
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
     9        ;
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
     14        ;
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2017        ;
    2118        Q
  • smart/trunk/p/C0SLAB.m

    r1571 r1591  
    11C0SLAB    ; GPL - Smart Lab Processing ;4/15/12  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
    5         ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
    10         ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
    15         ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2012 George Lilly. 
     4        ;
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
     9        ;
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
     14        ;
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        Q
  • smart/trunk/p/C0SMART.m

    r1571 r1591  
    11C0SMART   ; GPL - Smart Container Entry Points;2/22/12  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2012 George Lilly. 
    54        ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
    109        ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
    1514        ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        Q
  • smart/trunk/p/C0SMED.m

    r1571 r1591  
    11C0SMED    ; GPL - Smart Meds Processing ;2/22/12  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2012 George Lilly. 
    54        ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
    109        ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
    1514        ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        Q
  • smart/trunk/p/C0SMXMLB.m

    r1571 r1591  
    11MXMLBLD ;;ISF/RWF - Tool to build XML ;07/09/09  16:55 - Smart Container Ver.
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ; Public Domain
    34        QUIT
    45        ;
  • smart/trunk/p/C0SNHIN.m

    r1571 r1591  
    11C0SNHIN   ; GPL - Smart Container - OUTPUT OF NHINV ROUTINES;6/3/11  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2011-2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
    5         ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
    10         ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
    15         ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2011-2012 George Lilly. 
     4        ;
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
     9        ;
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
     14        ;
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        Q
  • smart/trunk/p/C0SNHINV.m

    r1571 r1591  
    11C0SNHINV        ;SLC/MKB - Serve VistA data as XML via RPC - Smart Container Version
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
    33        ;
    44        ; External References          DBIA#
  • smart/trunk/p/C0SPROB.m

    r1571 r1591  
    11C0SPROB   ; GPL - Smart Problem Processing ;5/01/12  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
    5         ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
    10         ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
    15         ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2012 George Lilly. 
     4        ;
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
     9        ;
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
     14        ;
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        Q
  • smart/trunk/p/C0SPROB2.m

    r1571 r1591  
    11C0SPROB   ; GPL - Smart Problem Processing ;5/01/12  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
    5         ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
    10         ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
    15         ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2012 George Lilly. 
     4        ;
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
     9        ;
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
     14        ;
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        Q
  • smart/trunk/p/C0STBL.m

    r1571 r1591  
    11C0STBL    ; GPL - Smart Container CREATE A TABLE OF NHINV VALUES;2/22/12  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3  ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    4  ;General Public License See attached copy of the License.
    5  ;
    6  ;This program is free software; you can redistribute it and/or modify
    7  ;it under the terms of the GNU General Public License as published by
    8  ;the Free Software Foundation; either version 2 of the License, or
    9  ;(at your option) any later version.
    10  ;
    11  ;This program is distributed in the hope that it will be useful,
    12  ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  ;GNU General Public License for more details.
    15  ;
    16  ;You should have received a copy of the GNU General Public License along
    17  ;with this program; if not, write to the Free Software Foundation, Inc.,
    18  ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    19  ;
    20  Q
    21 EN(BEGDFN,DFNCNT,ZPART) ; START IS A DFN
    22  I '$D(BEGDFN) S BDGDFN=""
    23  I '$D(DFNCNT) S DFNCNT=150
    24  I '$D(ZPART) S ZPART=""
    25  N ZTBL S ZTBL=$NA(^TMP("C0STBL"))
    26  N ZI,ZCNT,ZG
    27  S ZI=$O(^DPT(BEGDFN),-1)
    28  S ZCNT=1
    29  F  S ZI=$O(^DPT(ZI)) Q:((+ZI=0)!(ZCNT>DFNCNT))  D  ;
    30  . S ZCNT=ZCNT+1
    31  . W ZI," "
    32  . K ZG
    33  . D EN^C0SNHIN(.ZG,ZI,ZPART)
    34  . M @ZTBL@(ZI)=ZG
    35  . K G
    36  . N GDIR S GDIR="/home/vista/p/"
    37  . D EN^C0SMART(.G,ZI,"med")
    38  . I $D(G) W !,$$output^C0XGET1("G",ZI_"-med.rdf",GDIR)
    39  . k G
    40  . D EN^C0SMART(.G,ZI,"patient")
    41  . I $D(G) W !,$$output^C0XGET1("G",ZI_"-patient.rdf",GDIR)
    42  . K G
    43  . D EN^C0SMART(.G,ZI,"lab")
    44  . I $D(G) W !,$$output^C0XGET1("G",ZI_"-lab.rdf",GDIR)
    45  . K G
    46  . D EN^C0SMART(.G,ZI,"problem")
    47  . I $D(G) W !,$$output^C0XGET1("G",ZI_"-problem.rdf",GDIR)
    48  Q
    49  ;
    50 LOADHACK ;
    51  N ZI
    52  F ZI=2:1:374 D  ;
    53  . D IMPORT^C0XF2N("hack"_ZI_".xml","/home/vista/hack/")
    54  Q
    55  ;
    56 LABCNT ; COUNT LAB TESTS AND LOINC CODES
    57  K LABCNT,GLOINC,PATCNT
    58  S (LABCNT,GLOINC,PATCNT)=0
    59  N ZI S ZI=""
    60  N GN S GN=$NA(^TMP("C0STBL"))
    61  F  S ZI=$O(@GN@(ZI)) Q:ZI=""  D  ;
    62  . S PATCNT=PATCNT+1
    63  . I '$D(@GN@(ZI,"lab")) Q  ;
    64  . N ZJ S ZJ=""
    65  . F  S ZJ=$O(@GN@(ZI,"lab",ZJ)) Q:ZJ=""  D  ;
    66  . . S LABCNT=LABCNT+1
    67  . . S X=$G(@GN@(ZI,"lab",ZJ,"loinc@value"))
    68  . . I X'="" S GLOINC=GLOINC+1
    69  W !,"Total number of patients: ",PATCNT
    70  W !,"Total number of lab results: ",LABCNT
    71  W !,"Total number of lab results with loinc codes: ",GLOINC
    72  W !,"Percentage of lab tests with loinc codes: ",$P((GLOINC/LABCNT)*100,".")_"%"
    73  Q
    74  ;
    75 PROBCNT ; COUNT PROBLEMS AND SNOMED CODES
    76  K PROBCNT,GSNO,PATCNT
    77  S (PROBCNT,GSNO,PATCNT)=0
    78  N ZI S ZI=""
    79  N GN S GN=$NA(^TMP("C0STBL"))
    80  F  S ZI=$O(@GN@(ZI)) Q:ZI=""  D  ;
    81  . S PATCNT=PATCNT+1
    82  . I '$D(@GN@(ZI,"problem")) Q  ;
    83  . N ZJ S ZJ=""
    84  . F  S ZJ=$O(@GN@(ZI,"problem",ZJ)) Q:ZJ=""  D  ;
    85  . . S PROBCNT=PROBCNT+1
    86  . . S X=$G(@GN@(ZI,"problem",ZJ,"icd@value"))
    87  . . S Y=$$SNOMED^C0SPROB2(X)
    88  . . I Y'="" S GSNO=GSNO+1
    89  W !,"Total number of patients: ",PATCNT
    90  W !,"Total number of problems: ",PROBCNT
    91  W !,"Total number of problems with snomed codes: ",GSNO
    92  W !,"Percentage of problems with SNOMED codes: ",$P((GSNO/PROBCNT)*100,".")_"%"
    93  Q
    94  ;
    95 MEDCNT ; COUNT INPATIENT VS OUTPATIENT MEDICATIONS
    96  K MEDCNT,OMED,PATCNT,DOSE,UNITS,FORM,SCHED,ROUTE
    97  S (MEDCNT,OMED,GSNO,PATCNT)=0
    98  N ZI S ZI=""
    99  N GN S GN=$NA(^TMP("C0STBL"))
    100  F  S ZI=$O(@GN@(ZI)) Q:ZI=""  D  ;
    101  . S PATCNT=PATCNT+1
    102  . I '$D(@GN@(ZI,"med")) Q  ;
    103  . N ZJ S ZJ=""
    104  . F  S ZJ=$O(@GN@(ZI,"med",ZJ)) Q:ZJ=""  D  ;
    105  . . S MEDCNT=MEDCNT+1
    106  . . I $G(@GN@(ZI,"med",ZJ,"vaStatus@value"))="EXPIRED" D  Q  ;
    107  . . . I $D(DEBUG) W !,"Expired Mediation, Skipping"
    108  . . I $G(@GN@(ZI,"med",ZJ,"vaType@value"))="I" D  Q  ;
    109  . . . I $D(DEBUG) W !,"Inpatient Med, skipping"
    110  . . I $G(@GN@(ZI,"med",ZI,"vaType@value"))="V" D  Q  ;
    111  . . . I $D(DEBUG) W !,"IV Inpatient Med, skipping"
    112  . . S OMED=OMED+1
    113  . . S X=$G(@GN@(ZI,"med",ZJ,"form@value"))
    114  . . S FORM(X)=$G(FORM(X))+1
    115  . . S X=$G(@GN@(ZI,"med",ZJ,"doses.dose@dose"))
    116  . . I X="" S X="UNKNOWN"
    117  . . S DOSE(X)=$G(DOSE(X))+1
    118  . . S X=$G(@GN@(ZI,"med",ZJ,"doses.dose@units"))
    119  . . I X="" S X="UNKNOWN"
    120  . . S UNITS(X)=$G(UNITS(X))+1
    121  . . S X=$G(@GN@(ZI,"med",ZJ,"doses.dose@schedule"))
    122  . . I X="" S X="UNKNOWN"
    123  . . S SCHED(X)=$G(SCHED(X))+1
    124  . . S X=$G(@GN@(ZI,"med",ZJ,"doses.dosc@route"))
    125  . . I X="" S X="UNKNOWN"
    126  . . S ROUTE(X)=$G(ROUTE(X))+1
    127  W !,"Total number of patients: ",PATCNT
    128  W !,"Total number of medications: ",MEDCNT
    129  W !,"Total number of outpatient medications: ",OMED
    130  W !,"Percentage of outpatient medications: ",$P((OMED/MEDCNT)*100,".")_"%",!
    131  ZWR FORM
    132  ZWR DOSE
    133  ZWR UNITS
    134  ZWR SCHED
    135  ZWR ROUTE
    136  Q
    137  ;
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2012 George Lilly. 
     4        ;
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
     9        ;
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
     14        ;
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17        ;
     18        Q
     19EN(BEGDFN,DFNCNT,ZPART) ; START IS A DFN
     20        I '$D(BEGDFN) S BDGDFN=""
     21        I '$D(DFNCNT) S DFNCNT=150
     22        I '$D(ZPART) S ZPART=""
     23        N ZTBL S ZTBL=$NA(^TMP("C0STBL"))
     24        N ZI,ZCNT,ZG
     25        S ZI=$O(^DPT(BEGDFN),-1)
     26        S ZCNT=1
     27        F  S ZI=$O(^DPT(ZI)) Q:((+ZI=0)!(ZCNT>DFNCNT))  D  ;
     28        . S ZCNT=ZCNT+1
     29        . W ZI," "
     30        . K ZG
     31        . D EN^C0SNHIN(.ZG,ZI,ZPART)
     32        . M @ZTBL@(ZI)=ZG
     33        . K G
     34        . N GDIR S GDIR="/home/vista/p/"
     35        . D EN^C0SMART(.G,ZI,"med")
     36        . I $D(G) W !,$$output^C0XGET1("G",ZI_"-med.rdf",GDIR)
     37        . k G
     38        . D EN^C0SMART(.G,ZI,"patient")
     39        . I $D(G) W !,$$output^C0XGET1("G",ZI_"-patient.rdf",GDIR)
     40        . K G
     41        . D EN^C0SMART(.G,ZI,"lab")
     42        . I $D(G) W !,$$output^C0XGET1("G",ZI_"-lab.rdf",GDIR)
     43        . K G
     44        . D EN^C0SMART(.G,ZI,"problem")
     45        . I $D(G) W !,$$output^C0XGET1("G",ZI_"-problem.rdf",GDIR)
     46        Q
     47        ;
     48LOADHACK        ;
     49        N ZI
     50        F ZI=2:1:374 D  ;
     51        . D IMPORT^C0XF2N("hack"_ZI_".xml","/home/vista/hack/")
     52        Q
     53        ;
     54LABCNT  ; COUNT LAB TESTS AND LOINC CODES
     55        K LABCNT,GLOINC,PATCNT
     56        S (LABCNT,GLOINC,PATCNT)=0
     57        N ZI S ZI=""
     58        N GN S GN=$NA(^TMP("C0STBL"))
     59        F  S ZI=$O(@GN@(ZI)) Q:ZI=""  D  ;
     60        . S PATCNT=PATCNT+1
     61        . I '$D(@GN@(ZI,"lab")) Q  ;
     62        . N ZJ S ZJ=""
     63        . F  S ZJ=$O(@GN@(ZI,"lab",ZJ)) Q:ZJ=""  D  ;
     64        . . S LABCNT=LABCNT+1
     65        . . S X=$G(@GN@(ZI,"lab",ZJ,"loinc@value"))
     66        . . I X'="" S GLOINC=GLOINC+1
     67        W !,"Total number of patients: ",PATCNT
     68        W !,"Total number of lab results: ",LABCNT
     69        W !,"Total number of lab results with loinc codes: ",GLOINC
     70        W !,"Percentage of lab tests with loinc codes: ",$P((GLOINC/LABCNT)*100,".")_"%"
     71        Q
     72        ;
     73PROBCNT ; COUNT PROBLEMS AND SNOMED CODES
     74        K PROBCNT,GSNO,PATCNT
     75        S (PROBCNT,GSNO,PATCNT)=0
     76        N ZI S ZI=""
     77        N GN S GN=$NA(^TMP("C0STBL"))
     78        F  S ZI=$O(@GN@(ZI)) Q:ZI=""  D  ;
     79        . S PATCNT=PATCNT+1
     80        . I '$D(@GN@(ZI,"problem")) Q  ;
     81        . N ZJ S ZJ=""
     82        . F  S ZJ=$O(@GN@(ZI,"problem",ZJ)) Q:ZJ=""  D  ;
     83        . . S PROBCNT=PROBCNT+1
     84        . . S X=$G(@GN@(ZI,"problem",ZJ,"icd@value"))
     85        . . S Y=$$SNOMED^C0SPROB2(X)
     86        . . I Y'="" S GSNO=GSNO+1
     87        W !,"Total number of patients: ",PATCNT
     88        W !,"Total number of problems: ",PROBCNT
     89        W !,"Total number of problems with snomed codes: ",GSNO
     90        W !,"Percentage of problems with SNOMED codes: ",$P((GSNO/PROBCNT)*100,".")_"%"
     91        Q
     92        ;
     93MEDCNT  ; COUNT INPATIENT VS OUTPATIENT MEDICATIONS
     94        K MEDCNT,OMED,PATCNT,DOSE,UNITS,FORM,SCHED,ROUTE
     95        S (MEDCNT,OMED,GSNO,PATCNT)=0
     96        N ZI S ZI=""
     97        N GN S GN=$NA(^TMP("C0STBL"))
     98        F  S ZI=$O(@GN@(ZI)) Q:ZI=""  D  ;
     99        . S PATCNT=PATCNT+1
     100        . I '$D(@GN@(ZI,"med")) Q  ;
     101        . N ZJ S ZJ=""
     102        . F  S ZJ=$O(@GN@(ZI,"med",ZJ)) Q:ZJ=""  D  ;
     103        . . S MEDCNT=MEDCNT+1
     104        . . I $G(@GN@(ZI,"med",ZJ,"vaStatus@value"))="EXPIRED" D  Q  ;
     105        . . . I $D(DEBUG) W !,"Expired Mediation, Skipping"
     106        . . I $G(@GN@(ZI,"med",ZJ,"vaType@value"))="I" D  Q  ;
     107        . . . I $D(DEBUG) W !,"Inpatient Med, skipping"
     108        . . I $G(@GN@(ZI,"med",ZI,"vaType@value"))="V" D  Q  ;
     109        . . . I $D(DEBUG) W !,"IV Inpatient Med, skipping"
     110        . . S OMED=OMED+1
     111        . . S X=$G(@GN@(ZI,"med",ZJ,"form@value"))
     112        . . S FORM(X)=$G(FORM(X))+1
     113        . . S X=$G(@GN@(ZI,"med",ZJ,"doses.dose@dose"))
     114        . . I X="" S X="UNKNOWN"
     115        . . S DOSE(X)=$G(DOSE(X))+1
     116        . . S X=$G(@GN@(ZI,"med",ZJ,"doses.dose@units"))
     117        . . I X="" S X="UNKNOWN"
     118        . . S UNITS(X)=$G(UNITS(X))+1
     119        . . S X=$G(@GN@(ZI,"med",ZJ,"doses.dose@schedule"))
     120        . . I X="" S X="UNKNOWN"
     121        . . S SCHED(X)=$G(SCHED(X))+1
     122        . . S X=$G(@GN@(ZI,"med",ZJ,"doses.dosc@route"))
     123        . . I X="" S X="UNKNOWN"
     124        . . S ROUTE(X)=$G(ROUTE(X))+1
     125        W !,"Total number of patients: ",PATCNT
     126        W !,"Total number of medications: ",MEDCNT
     127        W !,"Total number of outpatient medications: ",OMED
     128        W !,"Percentage of outpatient medications: ",$P((OMED/MEDCNT)*100,".")_"%",!
     129        ZWR FORM
     130        ZWR DOSE
     131        ZWR UNITS
     132        ZWR SCHED
     133        ZWR ROUTE
     134        Q
     135        ;
  • smart/trunk/p/C0SUTIL.m

    r1571 r1591  
    11C0SUTIL   ; GPL - Smart Processing Utilities ;2/22/12  17:05
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2012 George Lilly. 
    54        ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
    109        ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
    1514        ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        Q
  • smart/trunk/p/C0SXPATH.m

    r1571 r1591  
    11C0SXPATH          ; CCDCCR/GPL - XPATH XML manipulation utilities; 6/1/08 ; 9/26/12 10:45am
    2         ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 4
    3         ;Copyright 2008-2012 George Lilly.  Licensed under the terms of the GNU
    4         ;General Public License See attached copy of the License.
    5         ;
    6         ;This program is free software; you can redistribute it and/or modify
    7         ;it under the terms of the GNU General Public License as published by
    8         ;the Free Software Foundation; either version 2 of the License, or
    9         ;(at your option) any later version.
    10         ;
    11         ;This program is distributed in the hope that it will be useful,
    12         ;but WITHOUT ANY WARRANTY; without even the implied warranty of
    13         ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14         ;GNU General Public License for more details.
    15         ;
    16         ;You should have received a copy of the GNU General Public License along
    17         ;with this program; if not, write to the Free Software Foundation, Inc.,
    18         ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     2        ;;1.0;VISTA SMART CONTAINER;;Sep 26, 2012;Build 5
     3        ;Copyright 2008-2012 George Lilly. 
     4        ;
     5        ; This program is free software: you can redistribute it and/or modify
     6        ; it under the terms of the GNU Affero General Public License as
     7        ; published by the Free Software Foundation, either version 3 of the
     8        ; License, or (at your option) any later version.
     9        ;
     10        ; This program is distributed in the hope that it will be useful,
     11        ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     12        ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13        ; GNU Affero General Public License for more details.
     14        ;
     15        ; You should have received a copy of the GNU Affero General Public License
     16        ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1917        ;
    2018        W "This is an XML XPATH utility library",!
Note: See TracChangeset for help on using the changeset viewer.