Help with C# Syntax

  • Thread starter Thread starter BlairRV
  • Start date Start date
B

BlairRV

Guest
I haven't written C# for a while. I am getting the following error and all the "=" are turning red in the Visual Studio editor in all the code that's BOLD. This is sample code from HL7 message writer. I think this is older C# syntax that needs to be updated. It's using .NET 2.0 framework. Thanks

Error: Invalid token '=' in class, struct, or interface member declaration

PipeParser parser = new PipeParser();

NHapi.Model.V231.Message.QRY_R02 qry = new

NHapi.Model.V231.Message.QRY_R02();

qry.MSH.MessageType.MessageType.Value ="QRY";

qry.MSH.MessageType.TriggerEvent.Value = "R02";

qry.MSH.MessageType.MessageStructure.Value = "QRY_R02";

qry.MSH.FieldSeparator.Value = "|";

qry.MSH.SendingApplication.NamespaceID.Value="CohieCentral";

qry.MSH.SendingFacility.NamespaceID.Value = "COHIE";

qry.MSH.ReceivingApplication.NamespaceID.Value="Clinical Data Provider";

qry.MSH.ReceivingFacility.NamespaceID.Value=facility;

qry.MSH.EncodingCharacters.Value = @"^~\&";

qry.MSH.VersionID.VersionID.Value = "2.3.1";

qry.MSH.DateTimeOfMessage.TimeOfAnEvent.SetLongDate(DateTime.Now);

qry.MSH.MessageControlID.Value = messageControlId;

qry.MSH.ProcessingID.ProcessingID.Value="P";

XCN st = qry.QRD.getWhoSubjectFilter(0);

st.AssigningAuthority.UniversalID.Value = facility;

st.IDNumber.Value = mrn;qry.QRD.QueryDateTime.TimeOfAnEvent.SetLongDate(DateTime.Now);

qry.QRD.QueryFormatCode.Value = "R";

qry.QRD.QueryPriority.Value = "I";

CE what = qry.QRD.getWhatSubjectFilter(0);

what.Identifier.Value = "RES";

return parser.encode(qry);




Continue reading...
 
Back
Top