We are currently updating the OP Help Center content for the release of OP 19, which is a member of the certified OP 14 family of products. OP 19’s official version is 14.19.1, which you may see in your software (such as in Help > About) and in the Help Center tabs labeled 14.19. You may also notice that the version number in content and videos may not match the version of your software, and some procedural content may not match the workflow in your software. We appreciate your patience and understanding as we make these enhancements.

SQL: Unbilled Vaccines

About

This report shows vaccines that were administered but were not billed between the two dates that you specify.

A sample image of this SQL report run in the Database Viewer is shown below:

Caveats

  • Vaccines without a matching CPT on the same date of service will flag as unbilled.  The appropriate CPT is determined by the assignment in Vaccine Setup.
  • Vaccines that are documented as given on a separate date than they were billed will appear as unbilled.

Code

To highlight and copy the code below to your clipboard, simply click the Copy button.

select distinct * from (
SELECT VACCINE1_1.PATNO, VACCINE1_1.VACNAME, 
       VACCINE1_1.VACDATE, VACCINE1_1.VFC1, 
       VACCINE1_1.ID, VACCINE1_1.ADMIN_ROUTE, 
       VACCINE1_1.CVXCODE, VACCINE1_1.OFFCODE, 
       ARCHIVE_TRANSACTIONS_1.CPTCODE, 
       ARCHIVE_TRANSACTIONS_1.DATE1, 
       VACCINE1_1.S_ADDR_ID, STAFF1_1.STAFFNAME
FROM VACCINE1 VACCINE1_1
      LEFT OUTER JOIN (select patno, date1, cptcode from ARCHIVE_TRANSACTIONS where cptcode between '90620' and '90756') ARCHIVE_TRANSACTIONS_1 ON 
     (ARCHIVE_TRANSACTIONS_1.PATNO = VACCINE1_1.PATNO)
      AND (ARCHIVE_TRANSACTIONS_1.DATE1 = VACCINE1_1.VACDATE)
      INNER JOIN VACNAMES VACNAMES_1 ON 
     (VACNAMES_1.VACNYC = VACCINE1_1.CVXCODE)
      INNER JOIN STAFF1 STAFF1_1 ON 
     (STAFF1_1.STAFFID = VACCINE1_1.S_ADDR_ID)
WHERE 
      ( VACCINE1_1.VACDATE BETWEEN :start_date and :end_date )
       AND ( VACCINE1_1.ADMIN_ROUTE IS NOT NULL  )
ORDER BY VACCINE1_1.PATNO, VACCINE1_1.VACDATE, 
         VACCINE1_1.VACNAME
) a
inner join register on register.patno = a.patno
where cptcode is null and lname <> 'TESTPATIENT'