0d9392db-ad05-47cc-8677-7b92da303d53
SQL
Data Source=ASHWIN;Initial Catalog=MPNetMD1
11in
true
8.5in
0.25cm
true
2.5cm
2.5cm
2.5cm
a5e7fd53-bbf6-4d7b-9ae5-b994f3803e86
21cm
PName
System.String
DOB
System.String
NHI
System.String
PGUID
System.Guid
DRUG_COUNT
System.Int32
DRUG_NAME
System.String
MPNetMD1
With expr (PName, DOB, NHI, PGUID) AS
(
SELECT distinct Person.FirstName+' '+Person.LastName, Convert(varchar(10),Person.DOB,120) AS DOB, Person.NationalRegistration, Record.SubjectGUID
FROM RecordData INNER JOIN
Record ON RecordData.RecordGUID = Record.RecordGUID INNER JOIN
Person ON Record.SubjectGUID = Person.PartyGUID
WHERE (RecordData.UseTypeID = 100000) AND (RecordData.FormatTypeID = 100000) AND (RecordData.Column3 LIKE 'H33%')
),
expr1 (PName, DOB, NHI, PGUID, DRUG_COUNT, DRUG_NAME) AS
(
SELECT Person.FirstName+' '+Person.LastName, Convert(varchar(10),Person.DOB,120) AS DOB, Person.NationalRegistration, Record.SubjectGUID, Count(Record.SubjectGUID) AS DRUG_COUNT, 'Ventolin' AS DRUG_NAME
FROM RecordData INNER JOIN
Record ON RecordData.RecordGUID = Record.RecordGUID INNER JOIN
Person ON Record.SubjectGUID = Person.PartyGUID
WHERE (RecordData.UseTypeID = 100022) AND (RecordData.Column3 LIKE '%ventolin%') AND (RecordData.EnteredDateTime >= getdate()-365) AND (RecordData.EnteredDateTime <= getdate())
Group by Record.SubjectGUID, Person.FirstName, Person.LastName, Person.DOB, Person.NationalRegistration
having Count(Record.SubjectGUID) >=6
),
expr2 (PName, DOB, NHI, PGUID, DRUG_COUNT, DRUG_NAME) AS
(
SELECT expr1.* FROM expr1 INNER JOIN
expr ON expr1.PGUID = expr.PGUID
)
SELECT * FROM expr2
true
26cm
1cm
textbox1
20.5cm
1
true
0.91429cm
Asthma Patients with Ventolin Prescription
MPNetMD1
0.91429cm
17.57936cm
PName
4
true
=Fields!PName.Value
NHI
3
true
=Fields!NHI.Value
DOB
2
true
=Fields!DOB.Value
DRUG_NAME
1
true
=Fields!DRUG_NAME.Value
DRUG_COUNT
true
=Fields!DRUG_COUNT.Value
0.53333cm
textbox2
9
true
Patient Name
textbox4
8
true
NHI
textbox3
7
true
DOB
textbox7
6
true
DRUG NAME
textbox5
5
true
DRUG COUNT
0.55873cm
true
5cm
2.53968cm
2.53968cm
3.25cm
4.25cm
2.00635cm
en-US
2.5cm
29.7cm