static const char *CopyrightIdentifier(void) { return "@(#)xxxxmdt.cc Copyright (c) 1993-2022, David A. Clunie DBA PixelMed Publishing. All rights reserved."; }
#include "xxxxdc.h"
#include "elmconst.h"

void 
XXXX_Header_BothClass::ToDicom_ManualDates(AttributeList *list,unsigned imagenumber)
{
	Assert(imagenumber==0);

	{
		// PatientAge

		// Xxxx is yyy;mm
		unsigned yyy=atoi(String_Use(XXXX_HeaderInstance_STDHDR->SAGE));
		unsigned mm =atoi((const char *)(String_Use(XXXX_HeaderInstance_STDHDR->SAGE))+4);

		ostrstream ost;
		if (yyy)
			ost << setw(3) << setfill('0')
			    << yyy << 'Y' << ends;	// blow off months
		else
			ost << setw(3) << setfill('0')
			    << mm  << 'M' << ends;	// a baby presumably

		char *agestr=ost.str();
		(*list)+=new AgeStringAttribute(TagFromName(PatientAge),agestr);
		if (agestr) delete[] agestr;
	}

	// StudyDate

	(*list)+=new DateStringAttribute(TagFromName(StudyDate),
		Date(String_Use(XXXX_HeaderInstance_STDHDR->SDATE)));

	// StudyTime

	(*list)+=new TimeStringAttribute(TagFromName(StudyTime),
		Time(String_Use(XXXX_HeaderInstance_STDHDR->STIME)));

	// ContentDate (formerly Image)

	(*list)+=new DateStringAttribute(TagFromName(ContentDate),
		Date(String_Use(XXXX_HeaderInstance_IMGHDR->IDATE)));

	// ContentTime (formerly Image)

	(*list)+=new TimeStringAttribute(TagFromName(ContentTime),
		Time(String_Use(XXXX_HeaderInstance_STDHDR->STIME)));

}

