The following was from our 3.7 instance, created in 2021.
Hopefully it at least gives you the concept of how we were parsing and
populating.
-- 
Bill Ott


On Tue, Feb 10, 2026 at 9:08 AM Cori Hundley <[email protected]> wrote:

> Hi Bill,
>
> If you wouldn't mind sharing your code diff, that would be appreciated! A
> few of my libraries are interested in implementing this, so even though it
> no longer works for you (and you're a different state), it might be a good
> starting point for me to get it working on our end.
>
> Thanks!
> Cori
> ------------------------------
> *From:* Murphy, Benjamin via Evergreen-general <
> [email protected]>
> *Sent:* Wednesday, February 4, 2026 12:44 PM
> *To:* Bill Ott <[email protected]>; Evergreen Discussion Group <
> [email protected]>
> *Cc:* Murphy, Benjamin <[email protected]>
> *Subject:* [Evergreen-general] Re: [External] Re: Scan the back of
> driver’s licenses to populate information?
>
> I hadn't thought about the possibility that different states could use
> different encoding.
>
> *Benjamin Murphy*
>
> NC Cardinal Program Manager
>
> State Library of North Carolina
>
> N.C. Department of Natural & Cultural Resources
> 919.814.6797
>
> [email protected]
> https://statelibrary.ncdcr.gov/services-libraries/nc-cardinal
>
>
>
> *Facebook <https://www.facebook.com/StateLibraryNC/>* | *Instagram
> <https://www.instagram.com/statelibrarync/>* |* YouTube
> <https://www.youtube.com/channel/UCC-ClbdzAy9XFi1pJem1FSQ>* | *LinkedIn
> <https://www.linkedin.com/company/state-library-of-north-carolina>*
>
> ------------------------------
> *From:* Bill Ott <[email protected]>
> *Sent:* Wednesday, February 4, 2026 11:05 AM
> *To:* Evergreen Discussion Group <[email protected]
> >
> *Cc:* Murphy, Benjamin <[email protected]>
> *Subject:* [External] Re: [Evergreen-general] Scan the back of driver’s
> licenses to populate information?
>
> You don't often get email from [email protected]. Learn why this is important
> <https://aka.ms/LearnAboutSenderIdentification>
> CAUTION: External email. Do not click links or open attachments unless
> verified. Report suspicious emails with the Report Message button located
> on your Outlook menu bar on the Home tab.
>
> We wrote a bit to do this years ago. It was simply a couple edits to
> t_edit.tt2 and regctl.js. I've got the code diff's if anyone is interested.
> We had it working for Michigan IDs, but I believe the state changed some
> encoding at some point and broke the field population. We've since
> abandoned it.
> --
> Bill Ott
>
>
> On Wed, Feb 4, 2026 at 10:30 AM Murphy, Benjamin via Evergreen-general <
> [email protected]> wrote:
>
> We had a request from an incoming member that I wanted to consult the rest
> of you on.
>
> Have any of you implemented a process that allows you to scan the back of
> driver’s licenses to populate information in library card applications?
> Looks like a barcode scanner has to be able to scan the PDF417  format, and
> I imagine there then needs to be a process to parse and plop that data into
> the proper patron registration form fields?
>
> *Benjamin Murphy*
>
> NC Cardinal Program Manager
>
> State Library of North Carolina
>
> N.C. Department of Natural & Cultural Resources
> 919.814.6797
>
> [email protected]
> https://statelibrary.ncdcr.gov/services-libraries/nc-cardinal
>
>
>
> *Facebook <https://www.facebook.com/StateLibraryNC/>* | *Instagram
> <https://www.instagram.com/statelibrarync/>* |* YouTube
> <https://www.youtube.com/channel/UCC-ClbdzAy9XFi1pJem1FSQ>* | *LinkedIn
> <https://www.linkedin.com/company/state-library-of-north-carolina>*
>
>
> ------------------------------
>
> Email correspondence to and from this address may be subject to the North
> Carolina Public Records Law and may be disclosed to third parties by an
> authorized state official.
> _______________________________________________
> Evergreen-general mailing list -- [email protected]
> To unsubscribe send an email to
> [email protected]
>
>
From f806d041fbf6662c00c286c2fae3d86c355fe829 Mon Sep 17 00:00:00 2001
From: "a.b" <[email protected]>
Date: Tue, 1 Jun 2021 13:46:05 -0400
Subject: [PATCH] add the "scan license" box

---
 openils/var/templates/staff/circ/patron/t_edit.tt2 |  9 ++++++
 .../web/js/ui/default/staff/circ/patron/regctl.js  | 34 ++++++++++++++++++++++
 2 files changed, 43 insertions(+)

diff --git a/openils/var/templates/staff/circ/patron/t_edit.tt2 
b/openils/var/templates/staff/circ/patron/t_edit.tt2
index 2bc53be..5b9a313 100644
--- a/openils/var/templates/staff/circ/patron/t_edit.tt2
+++ b/openils/var/templates/staff/circ/patron/t_edit.tt2
@@ -223,6 +223,15 @@ within the "form" by name for validation.
 </div>
 
 <div class="row reg-field-row">
+  <div class="col-md-3 reg-field-label">
+    <label>Scan License:</label>
+  </div>
+  <div class="col-md-3 reg-field-input">
+    <textarea class="form-control" ng-model="id_scan" 
ng-change="scan_state_id()"></textarea>
+  </div>
+</div>
+
+<div class="row reg-field-row">
   <div class="col-md-6">
     <ul class="nav nav-pills nav-pills-like-tabs">
       <li ng-class="{active : name_tab == 'primary'}">
diff --git a/openils/var/web/js/ui/default/staff/circ/patron/regctl.js 
b/openils/var/web/js/ui/default/staff/circ/patron/regctl.js
index 93f2dd8..aea513c 100644
--- a/openils/var/web/js/ui/default/staff/circ/patron/regctl.js
+++ b/openils/var/web/js/ui/default/staff/circ/patron/regctl.js
@@ -1830,6 +1830,40 @@ function($scope , $routeParams , $q , $uibModal , 
$window , egCore ,
         );
     }
 
+    /* the full regex is constructed by concatenating regex literals.
+    ... if it were a string, all the '\'s would need to be escaped,
+    and if it were a single literal, it would be really long.
+    using a 'let' instead of 'const' for now so it can be hacked from console 
*/
+    const state_id_rx = new RegExp([
+      /^@\s*ANSI\s*\d*DL\d*ZM\d*DLDCADCBDCDDBA\d{8}/,
+      /DCS(\w*)DCT([\w ]*)DBD\d{8}DBB(\d\d)(\d\d)(\d{4})DBC.DA.DA./,
+      /DAG([\w ]*)DAI([\w ]*)DAJ(\w\w)DAK(\d{5})\d{4}/,
+      /  DAQ([\w ]{17})DCF/
+    ].map((r) => r.source).join(''));
+    $scope.scan_state_id = function() {
+      const match = $scope.id_scan.match(state_id_rx);
+      if(!match){ return; }
+
+      const [ full_match,
+        last, firstmid,
+        dob_m, dob_d, dob_y,
+        street_addr, city, state, zip,
+        id_number ] = match;
+      $scope.patron.first_given_name = $scope.patron.first_given_name || 
firstmid;
+      $scope.patron.family_name = $scope.patron.family_name || last;
+      $scope.patron.dob = $scope.patron.dob || (new Date(dob_y, dob_m-1, 
dob_d));
+      // TODO: ident_type (state ID or drivers license)
+      $scope.patron.ident_value = $scope.patron.ident_value || 
id_number.replace(/ /g, '')+' ('+state+')';
+      $scope.patron.addresses[0].street1 = $scope.patron.addresses[0].street1 
|| street_addr;
+      $scope.patron.addresses[0].post_code = 
$scope.patron.addresses[0].post_code || zip;
+      // triggering the zip handler should autopopulate city, state, county, 
and country:
+      $scope.post_code_changed($scope.patron.addresses[0]);
+      $scope.patron.addresses[0].city = $scope.patron.addresses[0].city || 
city;
+      $scope.patron.addresses[0].state = $scope.patron.addresses[0].state || 
state;
+      // clear the input
+      $scope.id_scan = '';
+    };
+
     $scope.set_addr_type = function(addr, type) {
         var addrs = $scope.patron.addresses;
         if (addr['_is_'+type]) {
-- 
2.7.4

_______________________________________________
Evergreen-general mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to