Package Gnumed :: Package business :: Module gmCA_MSVA |
[frames] | no frames]

# Module gmCA_MSVA

source code

    GNUmed to MSVA (Canada) connector classes.

    Jim's notes:

    - source directory will reside on a Windows NTFS file system volume.
    - end-of-Record will be designated by Carriage Return and Line Feed
    - character set is "plain Western" (ISO Latin 1)
    - record mockup:

    FIRSTNAME           XXLASTNAME                 912345677300BC    196012251234512345M6       ADDRESS_LINE_1_XXXXXXXXXXADDRESS_LINE_2_XXXXXXXXXXCITY_XXXXXXXXXXXXXXXXXXXXBCA2A 2A2  604124456760489012340000000002009071307801

    - "PHN" + "Dependent #" + "Carrier ID" (in the above example "9123456773", "00", BC") work together as an identifier

    - format specification:

    *-- MSVAEX30.TXT format
    *--
    *--------------------------------------------------------------------
    *-- First Name          X(20)  No punctuations ( e.g. John Allen)
    *-- MSP Initials        X(02)  e.g. JA
    *-- Last Name           X(25)
    *-- PHN                 9(10)
    *-- Dependent #         9(02)  66 for newborn, otherwise zeros
    *-- Carrier ID          X(02)  Province providing coverage:
    *--                            BC, AB, SA, MB, ON, PQ, OI, NB, NS, NL, YT, NT, NU
    *-- Exempt              X(01)  "X" for exempt, otherwise blank
    *-- Opted-out           X(01)  "H" for Hard (Send payment to patient address)
    *--                            "S" for Soft (Send paymant to office address)
    *--                            Blank for Opted-in
    *-- Visits Used         9(02)  # of MSP visits used this calendar year, form zero up
    *--                            to 12 0r 15 depending on age.
    *-- Birthdate           9(08)  ccyymmdd
    *-- Payee #             9(05)
    *-- Practitioner #      9(05)
    *-- Sex                 X(01)  M, F
    *-- Chart #             X(08)
    *-- Street 1            X(25)
    *-- Street 2            X(25)
    *-- City                X(25)
    *-- Province            X(02)
    *-- Postal Code         X(09) A0A'b'0A0 or US Zip Code
    *-- Home Phone          9(10) If no area code use 3 leading zeros
    *-- Work Phone          9(10) If no area code use 3 leading zeros
    *-- SIN                 9(09)
    *-- Last Service Date   9(08) ccyymmdd
    *-- Referral Doctor     9(05)
    *--
    *-- Record size = 220 + <CR><LF> = 222 End-of-Record designated by Carriage Return and Line Feed.
    *-- File is ASCII text - Named "MSVAEX30.TXT"
    *-- X(n) = Aplhanumeric, left justified, padded with blanks
    *-- 9(n) = Numeric, leading zeros

    A0A'b'0A0:

            - standard Canadian postal code format which is 3 characters:
                    - (upper case letter + single digit number + upper case letter)
                    - followed by a breaking space
                    - followed by (number+letter number)

    US Zip code:

            - 12345 or 12345-1234

    Dependant # / Carrier ID

    I did some checking, and it seems in BC a corner case about
    the "00" being instead "66". The provision to designate
    newborns (as dependent "66" and, in the case of multiple
    births, "64" ... "63") seems now obsoleted by the ability of
    the hospital to log into the provincial system and generate
    a new Personal Health Number. Any such legacy values in
    Medical Manager would not be to drive the slave.

    The PHN can therefore be taken as unique *within* carrier
    ID. While the following may be far fetched, there is no
    agreement between Canada's provinces to avoid collisions, so
    it could be possible to exist

            BC.CA MOH | Personal Health Number | 90123456780
            ON.CA MOH | Personal Health Number | 90123456780

Version: $Revision: 1.2 $

Author: K.Hilbert <Karsten.Hilbert@gmx.net>

License: GPL

Functions
read_persons_from_msva_file(filename=None, encoding=None) | source code

Variables
| MSVA_line_len = `220`
| MSVA_dob_format = `'%Y%m%d'`
| MSVA_encoding = `'latin1'`

Imports: sys, codecs, time, pyDT, gmTools, gmDateTime, gmPerson