r5274 - branches/bmas-staging/lib/org/freemedsoftware/core

0 views
Skip to first unread message

subve...@svn.freemedsoftware.org

unread,
Mar 11, 2010, 12:02:47 PM3/11/10
to freemed-d...@googlegroups.com
Author: jeff
Date: 2010-03-11 12:02:46 -0500 (Thu, 11 Mar 2010)
New Revision: 5274

Modified:
branches/bmas-staging/lib/org/freemedsoftware/core/NcpdpXmlInterface.class.php
Log:
* More work in progress for NCPDP SCRIPT message support


Modified: branches/bmas-staging/lib/org/freemedsoftware/core/NcpdpXmlInterface.class.php
===================================================================
--- branches/bmas-staging/lib/org/freemedsoftware/core/NcpdpXmlInterface.class.php 2010-03-11 16:54:12 UTC (rev 5273)
+++ branches/bmas-staging/lib/org/freemedsoftware/core/NcpdpXmlInterface.class.php 2010-03-11 17:02:46 UTC (rev 5274)
@@ -114,6 +114,179 @@
return $msg;
} // end method createDirectoryDownloadMessage

+ public function patientElement( $patientId ) {
+ // TODO: pull from db
+ $msg = "";
+ $msg .= '<Patient>' . $this->EOL;
+ $msg .= ' <Identification>' . $this->EOL;
+ $msg .= ' <DocialSecurity>' . htmlentities( $p['ptssn'] ) .'</SocialSecurity>' . $this->EOL;
+ $msg .= ' </Identification>' . $this->EOL;
+ $msg .= ' <Gender>' . htmlentities( strtoupper( $p['ptsex'] ) ) . '</Gender>' . $this->EOL;
+ $msg .= ' <DateOfBirth>' . htmlentities( str_replace( $p['ptdob'], '-', '' ) ) . '</DateOfBirth>' . $this->EOL;
+ $msg .= ' <Address>' . $this->EOL;
+ $msg .= ' <AddressLine1>' . htmlentities( $p['line1'] ) . '</AddressLine1>' . $this->EOL;
+ $msg .= ' <City>' . htmlentities( $p['city'] ) . '</City>' . $this->EOL;
+ $msg .= ' <State>' . htmlentities( $p['state'] ) . '</State>' . $this->EOL;
+ $msg .= ' <ZipCode>' . htmlentities( $p['zip'] ) . '</ZipCode>' . $this->EOL;
+ $msg .= ' </Address>' . $this->EOL;
+ $msg .= ' <Email>' . htmlentities( $p['ptemail'] ) . '</Email>' . $this->EOL;
+ $msg .= '' . $this->EOL;
+ $msg .= ' <PhoneNumbers>' . $this->EOL;
+ $msg .= ' <Phone>' . $this->EOL;
+ $msg .= ' <Number>' . htmlentities( $p['pthphone'] ) . '</Number>' . $this->EOL;
+ $msg .= ' <Qualifier>TE</Qualifier>' . $this->EOL;
+ $msg .= ' </Phone>' . $this->EOL;
+ $msg .= ' </PhoneNumbers>' . $this->EOL;
+ $msg .= '</Patient>' . $this->EOL;
+ return $msg;
+ } // end method patientElement
+
+ public function pharmacyElement( $pharmacyId ) {
+ // TODO: pull from db
+ $msg = "";
+ $msg .= '<Pharmacy>' . $this->EOL;
+ $msg .= ' <Identification>' . $this->EOL;
+ $msg .= ' <XXXXID>' . htmlentities( $p['phncpdp'] ) .'</XXXXID>' . $this->EOL;
+ $msg .= ' </Identification>' . $this->EOL;
+ $msg .= ' <StoreName>' . htmlentities( $p['phname'] ) . '</StoreName>' . $this->EOL;
+ $msg .= ' <Address>' . $this->EOL;
+ $msg .= ' <AddressLine1></AddressLine1>' . $this->EOL;
+ $msg .= ' <City></City>' . $this->EOL;
+ $msg .= ' <State></State>' . $this->EOL;
+ $msg .= ' <ZipCode></ZipCode>' . $this->EOL;
+ $msg .= ' </Address>' . $this->EOL;
+ $msg .= ' <Email>' . htmlentities( $p['phemail'] ) . '</Email>' . $this->EOL;
+ $msg .= '' . $this->EOL;
+ $msg .= ' <PhoneNumbers>' . $this->EOL;
+ $msg .= ' <Phone>' . $this->EOL;
+ $msg .= ' <Number>' . htmlentities( $p['phphone'] ) . '</Number>' . $this->EOL;
+ $msg .= ' <Qualifier>TE</Qualifier>' . $this->EOL;
+ $msg .= ' </Phone>' . $this->EOL;
+ $msg .= ' </PhoneNumbers>' . $this->EOL;
+ $msg .= '</Pharmacy>' . $this->EOL;
+ return $msg;
+ } // end method pharmacyElement
+
+/*
+ EXAMPLE NCPDP SCRIPT NEWRX BODY:
+
+ <Body>
+ <NewRx>
+ <RxReferenceNumber>4444444</RxReferenceNumber>
+ <Pharmacy>
+ <Identification>
+ <XXXXID>7701630</XXXXID>
+ </Identification>
+ <StoreName>Acme Pharmacy</StoreName>
+ <Pharmacist>
+ <LastName>Jones</LastName>
+ <FirstName>Frank</FirstName>
+ </Pharmacist>
+ <PharmacistAgent>
+ <LastName>Smith</LastName>
+ <FirstName>Lucy</FirstName>
+ </PharmacistAgent>
+ <Address>
+ <AddressLine1>101 Main St.</AddressLine1>
+ <AddressLine2>Suite 343</AddressLine2>
+ <City>San Francisco</City>
+ <State>CA</State>
+ <ZipCode>94122</ZipCode>
+ </Address>
+ <Email>fr...@acmepharmacy.com</Email>
+ <PhoneNumbers>
+ <Phone>
+ <Number>4152239423</Number>
+ <Qualifier>NP</Qualifier>
+ </Phone>
+ <Phone>
+ <Number>6152205656</Number>
+ <Qualifier>TE</Qualifier>
+ </Phone>
+ </PhoneNumbers>
+ </Pharmacy>
+ <Prescriber>
+ <Identification>
+ <SPI>77777777</SPI>
+ <SocialSecurity>25021512</SocialSecurity>
+ </Identification>
+ <Name>
+ <LastName>Williams</LastName>
+ <FirstName>Mark</FirstName>
+ <MiddleName>S</MiddleName>
+ </Name>
+ <Specialty>
+ <Qualifier>AM</Qualifier>
+ <SpecialtyCode>IM</SpecialtyCode>
+ </Specialty>
+ <PrescriberAgent>
+ <LastName>Dinken</LastName>
+ <FirstName>Susy</FirstName>
+ </PrescriberAgent>
+ <Address>
+ <AddressLine1>1098 Stanyan Ave.</AddressLine1>
+ <City>Palo Alto</City>
+ <State>CA</State>
+ <ZipCode>94622</ZipCode>
+ </Address>
+ <Email>Mark.W...@drclinic.com</Email>
+ <PhoneNumbers>
+ <Phone>
+ <Number>6152219800</Number>
+ <Qualifier>TE</Qualifier>
+ </Phone>
+ </PhoneNumbers>
+ </Prescriber>
+ <Patient>
+ <Identification>
+ <SocialSecurity>222222222</SocialSecurity>
+ </Identification>
+ <Name>
+ <LastName>Turner</LastName>
+ <FirstName>Jeffery</FirstName>
+ <MiddleName>S</MiddleName>
+ </Name>
+ <Gender>M</Gender>
+ <DateOfBirth>19571129</DateOfBirth>
+ <Address>
+ <AddressLine1>3932 Park Blvd</AddressLine1>
+ <City>Menlo Park</City>
+ <State>CA</State>
+ <ZipCode>93555</ZipCode>
+ </Address>
+ <Email>Jeffery...@isp.com</Email>
+ <PhoneNumbers>
+ <Phone>
+ <Number>4153229482</Number>
+ <Qualifier>TE</Qualifier>
+ </Phone>
+ </PhoneNumbers>
+ </Patient>
+ <MedicationPrescribed>
+ <DrugDescription>Zoloft 50 MG tablets</DrugDescription>
+ <DrugCoded>
+ <ProductCode>2135021</ProductCode>
+ <ProductCodeQualifier>ND</ProductCodeQualifier>
+ <DosageForm>10</DosageForm>
+ <Strength>50</Strength>
+ <StrengthUnits>ME</StrengthUnits>
+ <DrugDBCode>420241241</DrugDBCode>
+ <DrugDBCodeQualifier>MC</DrugDBCodeQualifier>
+ </DrugCoded>
+ <DaysSupply>30</DaysSupply>
+ <Directions>Take 1 tablet twice a day with meals</Directions>
+ <Note>Ask patient if on other meds</Note>
+ <Refills>
+ <Qualifier>R</Qualifier>
+ <Quantity>2</Quantity>
+ </Refills>
+ <Substitutions>0</Substitutions>
+ <WrittenDate>19970801</WrittenDate>
+ </MedicationPrescribed>
+ </NewRx>
+ </Body>
+*/
+
} // end class NcpdpXmlInterface

?>

Reply all
Reply to author
Forward
0 new messages