That prescriptions object is initialized with emrApiAccessService. It uses emrApiAccessService.prescriptionsFromCache() which just calls window.external.Prescriptions. The JSON object that is returned has all prescriptions ever created on the patient (even during the visit), and that is pretty useful. Alas, after looking through the JSON object, I still don't see them giving us the pharmacy notes :-(. Below is what the JSON looks like for one of the prescriptions I created to test and see if it would show the notes. You could get the prescriptionID and pass it on to the find() I listed earlier if needed.
{
"personID": 0,
"prescriptionID": 1821518172969670,
"medicationID": 1821518172969620,
"medicationIDSpecified": true,
"medicationDetail": null,
"providerID": 0,
"providerIDSpecified": false,
"providerDetail": {
"loginName": null,
"groupList": null,
"providerID": 0,
"providerIDSpecified": false,
"lastPasswordChange": "\\/Date(-62135575200000)\\/",
"lastPasswordChangeSpecified": false,
"jobTitle": 0,
"jobTitleSpecified": false,
"jobTitleDetail": null,
"roleList": null,
"lastName": "Seale",
"firstName": "Michael",
"middleName": "T",
"homeLocation": 0,
"homeLocationSpecified": false,
"homeLocationDetail": null,
"currentLocation": 0,
"currentLocationSpecified": false,
"currentLocationDetail": null,
"deaNumber": null,
"licenseNumber": null,
"status": null,
"phone": null,
"authorizedLocationOfCares": null,
"isrespprov": 0,
"isrespprovSpecified": false,
"pmpRoleID": 0,
"pmpRoleIDSpecified": false,
"pmpRoleName": null,
"pidList": null,
"lastLoginDate": "\\/Date(-62135575200000)\\/",
"lastLoginDateSpecified": false,
"activationDate": "\\/Date(-62135575200000)\\/",
"activationDateSpecified": false,
"expirationDate": "\\/Date(-62135575200000)\\/",
"expirationDateSpecified": false,
"mqicUserName": null,
"specialty": 0,
"specialtySpecified": false,
"specialtyDetail": null,
"loginAttempts": 0,
"loginAttemptsSpecified": false,
"globalID": 0,
"globalIDSpecified": false,
"memberID": null,
"prescriberID": null,
"npi": null,
"spi": null,
"subscriptionureg": null,
"upin": null,
"data2000": null,
"authorizations": null,
"tocElectronicAddress": null,
"updateType": null,
"errorDetails": null,
"result": 0,
"resultSpecified": false
},
"userID": 0,
"userIDSpecified": false,
"userDetail": null,
"secondaryDocumentID": 1821517250597770,
"secondaryDocumentIDSpecified": true,
"documentDetail": null,
"change": 6,
"changeSpecified": true,
"quantity": "30",
"refills": "6",
"printInfo": null,
"rxType": "F",
"pubUser": 0,
"pubUserSpecified": false,
"pubUserDetail": null,
"pubtime": 0,
"pubtimeSpecified": true,
"pharmacy": "TEST Pharmacy\\r\\n130 Desiard st\\r\\nMonroe, LA 71201\\r\\nPh: (318) 361-0900\\r\\nFax: (318) 807-1120",
"clinicalDate": "\\/Date(1505916050000)\\/",
"clinicalDateSpecified": true,
"annotate": null,
"formularyStatus": null,
"formularyID": 0,
"formularyIDSpecified": false,
"formularyDetail": null,
"formularyConfidence": null,
"pharmacyBusinessID": 0,
"pharmacyBusinessIDSpecified": false,
"dispenseAsWritten": "N",
"exported": 0,
"exportedSpecified": false,
"dbCreateDate": "\\/Date(-62135575200000)\\/",
"dbCreateDateSpecified": false,
"dbUpdatedDate": "\\/Date(-62135575200000)\\/",
"dbUpdatedDateSpecified": false,
"bioSign": null,
"eRxAsyncResponse": 0,
"eRxAsyncResponseSpecified": false,
"eRxFmyListId": null,
"eRxFmyStatus": 0,
"eRxFmyStatusSpecified": false,
"pbmPatientUniqueId": null,
"bankIdNumber": null,
"cardholderName": null,
"cardholderId": null,
"payerName": null,
"groupNumber": null,
"comments": null,
"erxRenewalStatus": null,
"erxDenialReasonCode": null,
"erxDenialReasonOther": null,
"ncpdpid": null,
"ncpdpRxQtyQualifier": null,
"eRxUnitOfMeasureData": null,
"prescriptionOrderNumber": null,
"epcsErrorCode": 0,
"epcsErrorCodeSpecified": false,
"epcsErrorCodeDescription": null,
"epcsPrintedDate": "\\/Date(-62135575200000)\\/",
"epcsPrintedDateSpecified": false,
"epcsPrintedByPVID": 0,
"epcsPrintedByPVIDSpecified": false,
"isErxMeasureAllowed": null,
"erxPatient": null,
"erxPrescribedMedication": null
}