I can't find a service record for this man, probably one of the many that were badly damaged or destroyed.
Ancestry does have a record in the UK, British Army World War I Pension Records 1914-1920 dataset for William Patterson of the DLI, service no 14146.
If you have access to Ancestry at home or at the library then you would be able to download it. It is possible to sign up for a free trial but you'd need to be sure to cancel it before the end of the trial or they will charge.
Basically it says he was discharged in Jul 1917 as being medically unfit. He had pulmonary tuberculosis , not caused by , but was aggravated by his service.
As you haven't given us names of wife and children its difficult to be sure its the man you are looking for. There are 3 children mentioned George Henry, Elijah Venus and Sarah Carlisle. No mention of a James WIlliam
Sunderland Daily Echo and Shipping Gazette, 29 Dec 1917 , page 2 col 4
Deaths
PATTERSON On December 27th, aged 45, William, dearly beloved husband of Mary Patterson. To be interred at Ryhope Cemetery on Sunday December 30th. Cortege to leave residence, 117 Low Railway Street, Ryhope at 2.30 pm. All friends kindly invited.
Sunderland Daily Echo and Shipping Gazette, 27 Dec 1918 , page 2 col 4
In Memoriam - Roll of Honour
PATTERSON. In loving memory of my dear husband, Private William Patterson, 14th D.L.I. who died Dec 27th 1917, though gas received in action.
No one knows the parting
Or what the parting cos
But the Lord in His great mercy
Has gained what we have lost
- Sadly missed by his loving wife and family
Boo