File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,26 @@ module.exports = router => {
100100
101101 } )
102102
103+ router . post ( '/records/patient-search' , ( req , res ) => {
104+ const data = req . session . data
105+ const firstName = data . firstName ;
106+ const lastName = data . lastName ;
107+ const dateOfBirth = data . dateOfBirth ;
108+ const postcode = data . postcode ;
109+
110+ if ( firstName && lastName && dateOfBirth ) {
111+
112+ data . patientName = firstName + " " + lastName
113+ data . nhsNumber = '9123456788'
114+
115+ res . redirect ( '/records/patient-history' )
116+ } else {
117+ res . redirect ( '/records/patient-search' )
118+ }
119+
120+ } )
121+
122+
103123 router . get ( '/records/records/:id/:page' , ( req , res ) => {
104124
105125 const id = req . params . id
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ <h1 class="nhsuk-heading-l">Search for the patient</h1>
2323
2424 < p class ="nhsuk-body "> Make sure the details you enter match those registered with the patient’s GP.</ p >
2525
26- < form action ="/records/search-result " method ="post ">
26+ < form action ="/records/patient-search " method ="post ">
2727 {{ input({
2828 label: {
2929 text: "First name"
You can’t perform that action at this time.
0 commit comments